How to write not equal to in python?

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

In this way we write not equal to in python.
Subscribe
Login
Please login to comment
0 Discussion