Conditions in Python

Conditions in Python: True, False and Comparisons, Making Decisions with if, elif and else, Combining Conditions with and, or and not.

Updated

  1. True, False and Comparisons (Novice): A comparison such as height >= 48 asks Python a yes-or-no question, and its answer is a Boolean value, True or False, the value every decision a program makes is built on.
  2. Making Decisions with if, elif and else (Novice): An if statement runs its indented block only when its condition is True, elif tries the next condition when the ones above it were False, and else catches every case that's left, so a program takes the right path for each situation.
  3. Combining Conditions with and, or and not (Apprentice): and is True only when both conditions are True, or is True when at least one is, not flips True and False, and in checks whether text appears inside other text, which together turn a real rule with several parts into one condition.