Python not Keyword
ExampleGet your own Python Server
Return True if the statement is not True:
x = False
print(not x)
Try it Yourself »
Definition and Usage
The not
keyword is a logical operator.
The return value will be True
if the
statement(s) are not True
, otherwise it will
return False
.
Related Pages
The keywords or
,
and and
are also
logical operators.
Read more about operators in our Python Operators Tutorial.