Python Operator
Operators are the constructs which can manipulate the value of operands.
Consider the expression 4 + 5 = 9. Here, 4 and 5 are called operands and + is called operator.
![operator-operand operator-operand](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_356,h_290/http://blog.eduguru.in/wp-content/uploads/2016/01/operator-operand.png)
Types of Operator
Python language supports the following types of operators.
- Python Arithmetic Operators
Assume variable a holds 10 and variable b holds 20, then
![arithmetics operation arithmetics operation](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_554,h_352/http://blog.eduguru.in/wp-content/uploads/2016/01/arithmetics-operation.png)
- Python Comparison Operators
These operators compare the values on either sides of them and decide the relation among them. They are also called Relational operators.
Assume variable a holds 10 and variable b holds 20, then
![Comparison operators Comparison operators](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_727,h_373/http://blog.eduguru.in/wp-content/uploads/2016/01/Comparison-operators.png)
- Python Assignment Operators
Assume variable a holds 10 and variable b holds 20, then
![Assignment Operators python Assignment Operators python](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_722,h_351/http://blog.eduguru.in/wp-content/uploads/2016/01/Assignment-Operators-python.png)
- Python Bitwise Operators
Bitwise operator works on bits and performs bit by bit operation. Assume if a = 60; and b = 13; Now in binary format they will be as follows −
a = 0011 1100
b = 0000 1101
—————–
a&b = 0000 1100
a|b = 0011 1101
a^b = 0011 0001
~a = 1100 0011
There are following Bitwise operators supported by Python language
![bitwise operator pytohn bitwise operator pytohn](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_708,h_293/http://blog.eduguru.in/wp-content/uploads/2016/01/bitwise-operator-pytohn.png)
- Python Logical Operators
There are following logical operators supported by Python language.
Assume variable a holds 10 and variable b holds 20, then
![python logical operator python logical operator](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_710,h_141/http://blog.eduguru.in/wp-content/uploads/2016/01/python-logical-operator.png)
- Python Membership Operators
Python’s membership operators test for membership in a sequence, such as strings, lists, or tuples. There are two membership operators as explained below
![member operator python member operator python](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_710,h_145/http://blog.eduguru.in/wp-content/uploads/2016/01/member-operator-python.png)
- Python Identity Operators
Identity operators compare the memory locations of two objects. There are two Identity operators explained below:
![identity operator python identity operator python](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_707,h_138/http://blog.eduguru.in/wp-content/uploads/2016/01/identity-operator-python.png)
If you are going for finest contents like I do, just pay a
quick visit this web page everyday because it provides feature contents, thanks