Possible Duplicate:
Python Ternary Operator
Putting a simple if-then statement on one line
Is there a way to compress an if
/else
statement to one line in Python?
I oftentimes see all sorts of shortcuts and suspect it can apply here too.
Possible Duplicate:
Python Ternary Operator
Putting a simple if-then statement on one line
Is there a way to compress an if
/else
statement to one line in Python?
I oftentimes see all sorts of shortcuts and suspect it can apply here too.