Numbers and truth values

Michael Hoffman cam.ac.uk at mh391.invalid
Sat Apr 28 09:01:07 EDT 2007


Szabolcs wrote:

> Why is 1 == True and 2 == True (even though 1 != 2),

Not what I get.

Python 2.5 (r25:51908, Mar 13 2007, 08:13:14)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> 2 == True
False
-- 
Michael Hoffman



More information about the Python-list mailing list