Variables names:
- Can contain only letters ([a-zA-Z]), numbers ([0-9]), and/or underscores (_).
- Must start with a letter or underscore.
- Can't start with a number.
- Are case-sensitive.
- Can't use Python reserved keywords (or built-in function names).
As best practices, you should use
descriptive and lowercase for variable names (e.g., value)
and use all uppercase for constants (e.g., VALUE).
You should use underscores to join multi-word variable names (e.g., max_value, MAX_VALUE).
Define a variable:
Multiple assignment: Assign multiple variables with different values in one instruction:
Multiple assignment: Assign same value to multiple variables:
Swapping variables: