How to write not equal to in python?
![](https://pythonpoint.net/wp-content/uploads/2020/12/Pink-and-Blue-Abstract-Moms-Influencer-Freestyle-Art-YouTube-Channel-Art-5-1024x576.jpg)
There are two ways to write not equal to in python:-
- <> Only used in python 2
- != used in both python 2 and python 3.
Here we’ll see how to use it with some examples.
e.g.,
a=4 b=3 if (a!=b): print("a not equal to b") else: print("a equal to b")
output- a not equal to b
![](https://pythonpoint.net/wp-content/uploads/2020/12/Screenshot-1106-1024x414.png)
In this way we write not equal to in python.
Subscribe
Login
Please login to comment
0 Discussion