ProgrammingPython

Python ternary operator

Today's Python discovery: Python doesn't have the C style ?: ternary operator (e.g.: cond ? valueIfTrue : valueIfFalse). But as of Python 2.5 it has a ternary operator with its own syntax: value_when_true if condition else...