In Python, you declare a variable by writing the name, followed by = and the value:
score = 0score— the name you use to refer to this variable0— the initial value assigned to it
There is no need to specify a type. Python figures out the type from the value on the right.
Naming Rules#
- Names can contain letters, digits, and underscores.
- Names cannot start with a digit.
- Names are case-sensitive:
choiceandChoiceare different variables. - Use clear, descriptive names that reflect the value being stored.