1/14
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Variable
named item that holds a value
assignment statement
assigns a variable with a value
Reserved words
words that are part of the language and cannot be used as a programmer-defined name
object
represents a value and is automatically created by the interpreter when executing a line of code,For example, executing x = 4 creates a new object to represent the value 4
Garbage collection
deleting unused objects, automatic process that frees up space
Mutability
indicates whether the objects value is allowed to be changed
Immutable
means values cannot be changed, for ex. integer and strings cannot be changed
type()
returns the type of an object
id()
gives the value of an object’s identity
floating-point number
a real number that refers to the decimal point appearing anywhere(floating) in the number. ex. 0.0001 or 98.6
float
data type for floating point numbers(decimal point)
7.2e-4
0.00072
540,000,000
5.4e8
overflow
when a value is too large to be stored in the memory allocated by the interpreter
print(f"{my_float:.2f}")
syntax for outputting the float my_float with two digits after the decimal point