What is Python equivalent of the ! operator?

PythonServer Side ProgrammingProgramming

In C/C++, ! symbol is defined as not operator. Its equivalent in Python is not operator. It returns true if operand is false and vice versa

>>> not(True)
False
>>> not(False)
True
>>> not(20>30)
True
>>> not('abc'=='ABC')
True
raja
Published on 13-Feb-2018 15:00:16
Advertisements