Conditional Expressions in Python 2.4

A.M alanalan at newsgroup.nospam
Fri Jun 2 19:09:08 CEST 2006


>> a = 1 == 1 and "Yes" or "No"
>> a = ("No", "Yes")[1 == 1]

Smart! Thanks alot.





More information about the Python-list mailing list