Wed 29 Aug 2012
Python 101: The Ternary Operator
Posted by Mike under Cross-Platform, Python
[10] Comments
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. (more…)