1. What is a variable?
Variables are memory addresses that can be accessed through variable names, and variables are usually mutable.
2, how to define?
Variable format:
Variable name = "Variable Value"
For example:
" ZHANGHK "
Note: The variable name points to an address in memory, the variable name in the example, which is actually pointing to the place where the memory address is "ZHANGHK"
3. What are the requirements for the name of the variable?
Naming rules:
- Variable names can only be any combination of letters, numbers, or underscores
- The first character of a variable name cannot be a number
- The system reserved keywords cannot be used
- You should use a concise and meaningful variable name
- Usually using the Hump naming method, Hungarian nomenclature, etc., it is recommended to use the underscore method, example: Ip_master = "10.0.0.5"
- If it is a constant, all characters need to be capitalized, for example: PIE = 3.14
Python Basics-Variables