True False and None

suggest change

In Python 2, True, False and None are built-in constants. Which means it’s possible to reassign them.

True, False = False, True
True   # False
False  # True

You can’t do this with None since Python 2.4.

None = None  # SyntaxError: cannot assign to None

In Python 3, True, False, and None are now keywords.

True, False = False, True  # SyntaxError: can't assign to keyword

None = None  # SyntaxError: can't assign to keyword

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents