by Xixi · 13y ago · 0 comments
Nowadays you would do this: truecase if condition else falsecase
Personally, I prefer the brevity of the older syntax, but to each his own. However, I understand the "ternary" expression was added because the older syntax was error-prone:
http://mail.python.org/pipermail/python-dev/2005-September/0... http://www.python.org/dev/peps/pep-0308/