Conditionals
suggest changeIntroduction
Conditional expressions, involving keywords such as if, elif, and else, provide Python programs with the ability to perform different actions depending on whether a condition is true. Any value can be tested. It does not have to be the boolean True or False. This section covers the use of Python conditionals, boolean logic, and ternary statements.
Syntax
<expression> if <conditional> else <expression># Ternary Operator
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents