Python Ternary Conditional Operator
This article shows you how to write Python ternary operator, also called conditional expressions. <expression1> if <condition> else <expression2> expression1 will be evaluated if the condition is true, otherwise expression2 will be evaluated. 1. Ternary Operator 1.1 This example will print whether a number is odd or even. n = 5 print("Even") if n % …