A ternary operator is any operator that takes three arguments. For the ternary conditional operator " ? :" use the tag [tag:conditional-operator]. Also include the appropriate language tag.
A ternary operator is any operator that takes three arguments, as opposed to the usual two (binary operator) or one (unary operator).
The phrase "ternary operator" often refers to the most-commonly-used ternary operator, the conditional-operator, often denoted condition ? true_value : false_value
. For questions specific to that operator, use conditional-operator instead.
Other ternary operators
As "Other ternary operators besides ternary conditional (?:)" determined, there are other ternary operators in various languages. These include the BETWEEN
...AND
operator in SQL, chained conditionals like x < y < z
in Python and Common Lisp, and the slice operator start : stop : step
in Python.