Ternary Operators
Ternary Operators
A ternary operator is a shorthand, one-line way of writing an if-else statement. Instead of writing multiple lines of code for a simple assignment, you can evaluate a condition inline.
Syntax: value_if_true if condition else value_if_false