Python interpreter process for executing a python program: Python3 C:\test.py
1. Start the Python interpreter (in memory)
2. Read the C:\test.py content from the hard disk into memory (this step is the same as the text editor)
3. Execute code that reads into memory
If you want to permanently save your code, you need to use the file
If you want to debug your code, you need to use an interactive approach
Variable definition 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 following keywords cannot be declared as variable names [' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' Finall Y ', ' for ', ' from ', ' global ', ' if ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' Try ', ' While ', ' with ', ' yield ']
Variable
Define a variable, the stored data is a variable value
Variable name and variable value are just a binding relationship
The variable name itself does not have the ability to store values
The value of the reference count or the value of the body is bound to a variable named 0, the Python interpreter will periodically recycle their
Three important components of a variable definition
1 ID 2 type 3.value (value)
ID (variable name) Enter can get variable in ID
Type (variable name) Enter to get the types of variables
Directly enter the variable name return to get the value of the variable
Variable 1 is variable 2 is used to determine whether the IP of two variables is the same
Variable 1 = = Variable 2 = = To determine whether the value of two variables is the same
Two variables with the same value, when the number is equal to the hour, the IP is the same
IP is different when the value is large
Constants: Constant Amount
There is no specific way to define constants in Python, usually with variable names all capitalized to represent constants
Python Basic notes (i)