Python

Constant dripping wears away a stone

Conditions


Conditions in Python are evaluated for further actions. Depending on whether a condition is satisfied (True) or not (False), a different block of statements will be executed.

  • Conditional Statments:
    • if: When the condition in an if statement is true, a block of statements that is only executed when the if statement is true will be executed.
    • if...else...: When the condition in an if statement is false and there is an else statement, the block of statements for the else statement will be executed.
    • elif: When the condition in an if statement is false and there is a block of statements that is only executed when another condition is true, useelifcondition.