Question #628

What is the not equal operator in Python?

Answer

In Python, the syntax for the not equal operator is !=. Here is a simple example:

>>> a=4
>>> b=6
>>> if (a!=b):
>>>     print ('a not equal b')
a not equal b

3 events in history
Question by Alphonsio 01/11/2021 at 04:47:33 PM
What is the not equal operator in Python?
Answer by Alphonsio 01/11/2021 at 04:47:20 PM

In Python, the syntax for the not equal operator is !=. Here is a simple example:

>>> a=4
>>> b=6
>>> if (a!=b):
>>>     print ('a not equal b')
a not equal b

Question by Alphonsio 01/11/2021 at 04:44:31 PM
How to write the not equal operator in Python?
# ID Query URL Count

Icons proudly provided by Friconix.