Floor 4 - Computer Room
Santa Rosa de Lima English Secondary School
聖羅撒英文中學
Colégio de Santa Rosa de Lima - Secção Inglesa
1.
Review the concept of variable in Python
2.
Focusing on the syntax of variable
3.
Declare the variable for calculations
box
1.
A variable name must begin with a letter (a-z, A-Z) or an underscore (_).
2.
After the first character, you can use letters, numbers, or underscores.
3.
Variable names are case sensitive (myVar and myvar are different).
4.
You cannot use Python's reserved keywords as variable names (e.g., if, else, while).
5.
Variable names cannot contain spaces.
1variable = 10
A variable name can begin with a number.
variable_1 = 10
Variable names can contain underscores.
_1_variable = 10
Variable names can contain underscores.
my variable = 10
Python variable names can include spaces.
var@name = 10
Special characters like @, #, and $ can be used in variable names.
if = 10
Reserved keywords can be used as variable names.
if_while = 10
Two Reserved keywords mixing together can be used as variable names.