Operators in Python
Tags: beginners, programming, python, operators
Published: 2022-07-26 12:44:46

**1.Introduction**
Operators are some unique symbols which are used to carry out various functions. They are predefined in Python.
NOTE-On which the operators are used are known as the operand.
For example-![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n18i3auguaspltf8raz8.png)
 
In the above example we have used + as a operator and a and b are the operand.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hlmx7y0ur65fjqa0g8y0.png)
**2.operators in Python are majorly classified into 5 different types**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mn97kzf6gyfqsuphc1no.png)
 
**3.Arithmetic operator**
It includes numeric values as we use in mathematics.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bpefcfmyh7wl1g4n3d1s.png) 
For example-![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1vmor347rpl9mcv5izoa.png)
output
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hgwp3vbcffehkd8cq1qx.png)  
**4.Assignment operator**
These operators are used to assign some data to any unknown variables.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/txfkj7n67f8o2onjwsoo.png) 
For example-![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/djtfmdywa9e07ym4jsld.png)
output
 ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ztjy9numtg6sdytk6ect.png) 
`**5.Logical operator**
These operator are used to combine two or more statements.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylhcex1r26kr3yg8shei.png) 
For example-![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1tdses4w6vuro5h0fb4d.png)
output
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9nksn6n3bwleh1l2aa5.png)  
**6.Comparison operator**
This kind of operators are used to compare two statements.
They gives us the output in TRUE  or FALSE .
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4qgdpp0as405jf7b1hs.png)
For example-![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22wocomfbp4zilgedp2c.png)
output
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnn3da42013bgwwr09og.png)
example-![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zpl13bl1rje1y9fkveoy.png)
output
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yqjarymkimhau9hxa4qu.png)
    
**7.Identify operators**
These operators are used to compare the variables if both the statements contain same kind of data in them.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9689qypl12udpzympuri.png) 
For example 1 -![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pljw0luwst5whn0wq72j.png)
output
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w1uqkncc7d2kv2fn3aca.png)
2.![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bnr8hyzbqzno3yyt782p.png)
output
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9cp9lkd3c2pdd9gdxfou.png)