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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is name binding?

A

Assigning an interpreted object to a variable that is stored
- A name can only store one object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an identifier?

A

The name of a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly