if the else short form

saeed.gnu saeed.gnu at gmail.com
Sun Oct 10 02:48:31 EDT 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