A variable lets you give a value a name and use it later. Thinking of a labeled box is a useful first picture, although in Python the name is more precisely a reference to an object.

Assign a value
name = "Lan"
This statement assigns the string "Lan" to name. In a script, assignment by itself does not print anything. Use print when you want to display the value:
name = "Lan"
print(name)
Lan
Choose a valid name
Use readable names such as name or student_name. Reserved keywords such as return and try cannot be variable names. A built-in name such as print is different: Python permits assigning to it, but then you hide the function and may break a later call.
student_name = "Lan" # Valid and descriptive.
# return = "Lan" # Invalid: return is a keyword.
# try = "Lan" # Invalid: try is a keyword.
# print = "Lan" # Legal assignment, but shadows print().
Names are case-sensitive, so name and Name are different. Their availability also depends on scope; defining a variable inside a function does not automatically make it available everywhere.
Try it
Assign your own name to a variable and print it. Then change the value and run the script again. The idea is small, but it appears throughout Python programs.
Adapted from the original Chinese article, published on April 9, 2025.

Comments NOTHING