Function: Store data, be called, identify data (variable data is stored in memory, data is temporary)
name = "abc"
#name: variable name abc: value of variable name
print (name)
#Call the name variable and print the variable
## Important note:
Characters in Python with single or double quotes are considered strings by Python.
Declaration rules:
1. Must have identification meaning
2. Variable names can only be a combination of letters, numbers or underscores
3. The first letter cannot be a number
4.Python built-in variables cannot be used as variable names (for example: and, class)
Key examples:
name = "aaa"
name2 = name
print (name, name2)
name = "bbb"
print (name name2)
Output:
aaa,aaa
bbb,aaa
The above is the detailed content of Definition of python variables. For more information, please follow other related articles on the PHP Chinese website!