Conditional Expressions

if/else

What’s New in Python 2.5:

a = 1 if x > 15 else 2

minimum_length = 2 if is_parent else 1
result = module_elements[-2 if is_parent else -1]