Types of Operators in Python
1 ) Arithmetic Operators.
2 ) Assignment Operators.
3) Relational Operators.
4) Logical Operators.
5 ) Membership Operators.
6 ) Identity Operators.
7 ) Bitwise Operators.

1 ) Arithmetic Operators.
Operators Description // Perform Floor division(gives integer value after division) + Used for addition  used to perform subtraction * used to perform multiplication / used to perform division % used to return remainder after division(Modulus) ** Perform exponent(raise to power) a=56; b=12; print(a//b) print(a+b) print(ab) print(a*b) print(a%b) print(a/b)
Output:4 68 44 672 8 4.666666666666667

2 ) Assignment Operators
Operators Description = Assignment /= Divide and Assign += Add and assign = Subtract and Assign *= Multiply and assign %= Modulus and assign **= Exponent and assign //= Floor division and assign #example of assignment operators x=50 # = is assignment operator y=1 y+=40 # arithmetic assignment operator x=20 # arithmetic assignment operator z=3 # arithmetic assignment operator z*=40 # arithmetic assignment operator p=10 # arithmetic assignment operator p//=2 # arithmetic assignment operator #Printing the values of the variables print(x) print(y) print(z) print(p)
Output:30 41 120 5

3) Relational Operators
Operator Meaning > Greater that  True if left operand is greater than the right < Less that  True if left operand is less than the right == Equal to  True if both operands are equal >= Greater than or equal to  True if left operand is greater than or equal to the right <= Less than or equal to  True if left operand is less than or equal to the right != Not equal to  True if operands are not equal x=6 y=9 print(x==y) print(x>y) print(x<y) print(x!=y) print(x>=y)
Output:False False True True False

4) Logical Operators.
Operator Meaning and True if both the operands are true or True if either of the operands is true not True if operand is false (complements the operand) x= True y = False # Output: x and y is False print('x and y is',x and y) # Output: x or y is True print('x or y is',x or y) # Output: not x is False print('not x is',not x)
Output:x and y is False x or y is True not x is False