Chapter 2 Flashcards
1
Q
What is an object?
A
Represents a value, it is automatically created as the code runs
- Unnecessary objects are deleted after use, for example printing the value 4, the value 4 has to be represented but not remembered or stored anywhere, so the object is thrown away from memory after use
2
Q
What is name binding?
A
Assigning an interpreted object to a variable that is stored
- A name can only store one object
3
Q
What does the .id() function do?
A
Describes the object passed as a numerical value that represents the memory address of the object
4
Q
What is an identifier?
A
The name of a variable
5
Q
What are may an illegal identifier include?
A
- Start with a number
- Special characters that are not ‘_’
- Reserved functions built into python
- Cannot lead with double ‘__’, the interpreter actually changes the variable name if this happens