if the else short form

saeed.gnu saeed.gnu at gmail.com
Sun Oct 10 08:48:31 CEST 2010


>>> True == 1
True
>>> False == 0
True
>>> int(True)
1
>>> int(False)
0
>>> bool(1)
True
>>> bool(0)
False


‌But:
str(fill==True)+','
is simpler than:
("False,", "True,")[fill==True]



More information about the Python-list mailing list