Various kinds of special symbols that are used for logical and arithmetical computations are called Python operators.
Python operators are divided into the following categories.
1. Arithmetic operators
As the name suggests, arithmetic operators are used for performing simple calculations such as addition, subtraction, division, and multiplication.
x - y = 11
print(‘x – y =’,x-y)
2. Assignment operators
Value assigning to variables are performed by assignment operators in python.
Example: =, +=,-=,*=, >>=, <<=.
3. Comparison operators
As the name suggests a comparison of values is done by comparison operators as per the condition to determine whether it’s true or false.
Example: ==, !=, > , < , >= ,<=
4. Logical operators
Operators used to join conditional statements are known as logical operators.
Example: And, or, not.
5. Bitwise operators
Their functions are often in bits hence they earn the name and they act as if binary digits.
Example: &, | , ^ , <<, >> etc