Go back to post Create new comment
Since Python 2.5 you can do ternary operations like so:
f() if h() else g()
http://docs.python.org/reference/expressions.html
Dive into Python also gives a good overview of solving it the long way:
http://diveintopython.org/power_of_introspection/and_or.html
Go back to post
A preview of your comment:
Since Python 2.5 you can do ternary operations like so:
http://docs.python.org/reference/expressions.html
Dive into Python also gives a good overview of solving it the long way:
http://diveintopython.org/power_of_introspection/and_or.html