The following 7 types of operators are supported in Python:
1. Arithmetic operators:
+ (plus),-(minus), * (multiply),/(except),% (remainder), * * (Power): Returns the Y power of X,//(DIVISIBLE): Returns the integer part of the quotient
2. Comparison operator: (returns a Boolean value)
= = (equals),! = (not equal to),> (greater than),< (less than), >= (greater than or equal), <= (less than or equal)
3. Assignment operators:
= (simple assignment operator), + = (addition assignment operator): C+=a, equivalent to c=c+a,-= (subtraction): Same usage as addition operator, *= (multiplication),/= (division),%= (modulo assignment operator), **= (power assignment operator),//= (rounding assignment operator)
4. Logical operators:
and (Boolean and, and): If X is False,x and y is false, otherwise the computed value of y is returned, or (boolean "or"): Returns True,not (boolean "non") if one of the criteria is reached: False if X is True
5. Bitwise operators:
&: (bitwise operator): If the two corresponding bits of the two values participating in the operation are 1, the result of that bit is 1: otherwise 0
|: (bitwise OR operator) as long as the corresponding two bits have one of 1, the result bit is 1
^: (bitwise XOR OR operator) when two corresponding bits differ, the result is 1
~: (bitwise inverse operator) for each binary inverse of the data, which turns 1 to 0 and 0 to 1
<<: (left movement operator) all bits of the operand are left shifted by the number of digits specified by the << right, high drop, low 0
6. Member Operators:
In: Returns True if a value is found in the specified sequence, otherwise it returns false
Not in: Returns True if no preference is found in the specified sequence, otherwise false
7. Identity operator:
is: Determines whether two identifiers are referenced from an object
is not: Used to determine whether two identifiers are referenced from different objects
Self-hing Artificial intelligence--python operators and manipulating objects