4 ms·
Show HN: An inconsistent logic in python 2.7
Python 2.7.6 (default, Nov 21 2013, 15:55:38) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> True = False
>>> 3 == 3 == True
False
- sp332 12y agoIt's not inconsistent. The variable "True" now has the value False. 3 == 3 yields the value True, which is not equal to the value in the variable "True" which is False. You should try: >>> True = False >>> 3 == 3 == bool("True")