Daily Archives: August 29, 2012

Python 101: The Ternary Operator

There are a lot of computer languages that include the ternary (or tertiary) operator, which is basically a one-line conditional expression in Python. If you’re interested, you can read about the various ways it’s rendered in other languages over on Wikipedia. Here we will spend some time looking at several different examples and why you might use this operator in real life. Continue reading Python 101: The Ternary Operator