Python not Keyword

Example

Returns True if the statement is not True:

x = False
print(not x)

Run Example

Definition and Usage

The not keyword is a logical operator.

Returns True if the statement is not True, otherwise returns False.

Related Pages

Keywords or and and It is also a logical operator.

Please visit our Python Operator Tutorial Learn more about operators in Chinese.