Python ternary operator: Definition and effective ways to implement it
Python ternary operators are terse conditional expressions. These are operators that check a condition and then assess a value in light of that. This has been accessible ever since PEP 308 was authorized and is now in version 2.4. If used correctly, this operator may make code smaller and easier to comprehend.