Ternary Operator in Python: To Use or Not to Use? — CODEFATHER

Does Python have a ternary operator? Yes it does!

In this tutorial you will learn everything about it so you can use it in your programs.

The Python ternary operator (or conditional expression) works on three operands and it allows to write the logic of an if else statement in a single line of code. With the ternary operator you