Variables and Expressions Flashcards
What is a variable?
a named item, such as x or num_people, that holds a value.
What is incrementation?
A statement that causes a variable’s value to increase.
What is an identifier?
The name of a variable.
What are the rules for identifers?
Cannot start with a number. Cannot contain special characters other than underscore. Cannot be a reserved word.
What is an object?
Any item in Python.
What is name binding?
The process of associating names with interpreter objects.
What is garbage collection?
The process of deleting unnecessary objects.
What are the properties of objects?
Value, Type and Identity.
What is id()?
A function that returns the memory address an object is stored at.
What is type()?
A function that returns the type of an object
Are strings mutable?
No.
Are integers mutable?
No.
What is Overflow?
An error that occurs when a value is too large to be stored in the memory allocated by the interpreter.
What are the minimum and maximum floating point values?
Min: 2.3 x 10^-308, Max: 1.8 x 10^308
How do you manipulate significant figures in Python?
Use print(f’{}’). Put variable:.xf inside the curly brackets with x indicating the desired decimal place.