operator continuation
1 arithmetic operations
2 comparison operations
3 Assignment operations
4-bit operation:
Note:
5 Logical operations
and annotations:
1 in Python, and and of the Boolean logic calculus, as you expect, but they do not return a Boolean value: instead, return
One of the values that they actually compare.
2 The value of a left-to-go calculation expression in a Boolean context, if all values in the Boolean context are true,
Then and returns the last value.
3 If a value in a Boolean context is false, and returns the first false value
or annotations:
1 when using or, from left to right in a Boolean context, just like and, if a value is true,
or returns the value immediately
2 If all values are false, or returns the last False value
3 note or in a Boolean context, the expression calculus is always performed until a true value is found and then ignored
The remaining comparison values
And-or Results using:
1 combined with the previous two kinds of grammar, reasoning can be.
2 in order to enhance the readability of the program, preferably with parentheses, columns such as:
(1 and X ") or ' Y '
6 Member operations
7 Identity operations
8 Operation priority: top-down, priority high to low
Summary of standard data types
Differentiate by number of stored values
Scalar/Atomic Type |
Number, string |
Container type |
list, tuple, dictionary |
By Variable immutable distinction
Variable |
List, dictionary |
Not variable |
Numbers, strings, tuples |
Differentiate by Access order
Direct access |
Digital |
Sequential access (sequence type) |
String, list, tuple |
Key value access (mapping type) |
Python jobs (operator continuation)