Why am I able to assign the Python keyword True
to equal the Python keyword False
using Python 2.7.9?
Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>>> True
True
>>> True = False
>>> True
False
>>>
But when switching over to Python 3.4.3:
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>>> True = False
File "<stdin>", line 1
SyntaxError: can't assign to keyword
>>>