This is the content of the December plan, beginning in January 2018 ~
If there is any mistake, please ask for it ~
This thing is actually very similar, choose a few special. Also, Python has no ++,--.
Just two, take a look.
| ** |
Power-Returns the Y power of X |
A**b is 10 of the 21-time Square |
| // |
Divide-Returns the integer part of the quotient |
9//2 output result 4, 9.0//2.0 output 4.0 |
1 Print (A) 2 Print (1.0/2) 3 Print (5//2) 4 Print (2**3)
0.50.528
python logical operators
| and |
X and Y |
Boolean "and"-if x is False,x and y returns FALSE, otherwise it returns the computed value of Y. |
(A and B) returns 20. |
| Or |
X or Y |
Boolean "or"-if x is True, it returns the value of x, otherwise it returns the computed value of Y. |
(A or B) returns 10. |
| Not |
Not X |
Boolean "Non"-returns False if X is True. If X is False, it returns TRUE. |
Not (A and B) returns False |
python identity operator
| operator |
Description |
Example |
| Is |
is to determine whether two identifiers are referenced from an object |
x is y, similar to ID (x) = = ID (y) , returns True if the same object is referenced, otherwise False |
| is not |
Is does not determine whether two identifiers are referenced from different objects |
x is not y, similar to ID (a)! = ID (b). Returns True if the reference is not the same object, otherwise False is returned. |
The return value of the ID method is the memory address of the object.
Python operator Four