Catalog :

  1. Constant

  2. Variable

  3. Classification of operators

    3.1 Arithmetic operator

    3.2 Comparison operator

    3.3 Assignment operator

    3.4 An operator

    3.5 Identity operation

    3.6 Members of the operation

    3.7 Logical operations

1. Constant
Definition : A quantity that does not change state during program execution

The definition of constant :

1.1 Constant names can only be letters , Any combination of Numbers or underscores

1.2 Constant names cannot start with numbers

1.3 Constant names cannot be keywords

1.4 Constants are usually capital letters

Example :

APP_NAME="my_web"

2. Variable
Before we talk about operators , First, we need to popularize the concept of variables , Variable literally means the amount by which the value can change , Because the essence of our program is the change of quantity state , So there is a mechanism to mark and respond to this state change .

Variable definition specification :

2.1 Variable names can only be letters , Any combination of Numbers or underscores

2.2 Variable name cannot start with a number

2.3 python The keyword for cannot be a variable name (and,is,not,or,print,if,else,for,form,in,class,def wait )

2.4 Try to define it intentionally , Try to use recognizable English words , The words are connected with the underscores before the words

2.5 Try to use lowercase schema definitions

Example :

state_flag=True
a=110
b=220
c=a+b

3. Classification of operators
3.1 Arithmetic operator

Python_ Learning operators
3.2 Comparison operator

Python_ Learning operators
3.3 Assignment operator
Python_ Learning operators
3.4 An operator
Python_ Learning operators
3.5 Identity operation
Python_ Learning operators

3.6 Members of the operation
Python_ Learning operators
3.7 Logical operations
Python_ Learning operators

 From left to right
priority :() not and or
python The rules in the :1( Nonzero integer ):True,0:False
skill : If the left is not zero, take the right , To the right of zero ,and contrary
Example :
1 or 2 ----> 1
0 or 3 ----> 3
1 and 0 -----> 0