Often, the value of a certain variable will take one of two values based on a condition.
For example:
if age > 50:
age_description = "old"
else:
age_description = "young"
This comes up enough that Python, and other languages offers a shortcut.
Ternary operators accomplish this same task in one line, and can dramatically increase readability. It's called a ternary operator because it has three parts:
value_if_true if condition else value_if_false
For example, the code in the previous section could be stated like this:
age_description = "old" if age > 50 else "young"
Or you could implement something like absolute value like this:
abs_value = x if x >= 0 else -x