Related calculations
Operation |
Description |
Operation |
Description |
X + y |
Addition |
X * * y |
Powers |
X-y |
Subtraction |
X% y |
modulo (x mod y) |
X * y |
Multiplication |
+x |
One-dollar addition |
X/Y |
Division (2.6 Omit the number of decimal parts) |
-Y |
One-dollar subtraction |
X//Y |
Truncate except |
X if y else Z |
Three-dimensional expression |
Compare operations
Operation |
Description |
Operation |
Description |
|
X << y |
X left shift y bit |
X \ |
Y |
Bitwise OR |
X >> y |
x right Shift y bit |
x ^ y |
Bitwise XOR OR |
|
X & Y |
Bitwise-AND |
~x |
Bitwise negation |
|
Some notes about the numbers
Is_integer
Test whether a floating-point number is an integer official document
and value-dependent modules math
,random
Int () and Math.trunc () omit the fractional part, and the round () function can be rounded, with the math.floor holding the decimal place at 2.7 for 0, and the int effect at 3.0.
python3.0 no longer supports dictionary comparison sizes and can be replaced with sorted (Dict.items ())
Set Set
Add () Insert
Update () set by location
Remove () Deletes an item by value
Why use collections?
Filter out Duplicates
Record locations that have been visited