News

Python also allows us to use conditional expressions (or ternary operators) to evaluate the truthiness of complex statements in a single line. age = 1 is_baby = 'baby' if age < 2 else 'not a baby' ...
I recently switched to using python 2.5 from 2.4, one of the new language level features in 2.5 is conditional expressions. Which I thought was odd because I was already writing conditional ...
NOTE: and takes precedence over or in Python. Depending on how you write your conditional statement(s), you may need to group pieces together with parentheses so that they are evaluated together.