The general form of an assignment statement:
variable = expression
Example assignment statements:
>>> base = 20 >>> height = 12 >>> area = base * height / 2 >>> area 120.0
The rules for executing an assignment statement:
- Evaluate the expression. This produces a memory address.
- Store the memory address in the variable.
The rules for legal Python names:
- Names must start with a letter or
- Names must contain only letters, digits, and
For Python, in most situations, the convention is to use
pothole_case (or Snake Case) in Python: