Python If Not
Not
The not keyword is a logical operator, and
is used to reverse the result of the conditional statement:
Example
Test if a is NOT greater than
b:
a = 33
b = 200
if not a> b:
print("a is NOT greater than b")
Try it Yourself »
b = 200
if not a> b:
print("a is NOT greater than b")
Related Pages
Python If...Else Tutorial If statement If Indentation Elif Else Shorthand If Shorthand If Else If AND If OR Nested If The pass keyword in If