Is there something similar to ?: operator (C/C++) in Python?

Paul Rubin http
Tue Jun 28 21:17:27 EDT 2005


Scott David Daniels <Scott.Daniels at Acm.Org> writes:
>      result = [(lambda: expr0), lambda: expr1][cond]()

Winner of the "there should be one obvious way to do it" award.  ;-)



More information about the Python-list mailing list