Python · Lesson 3.2 · Pro

if, elif and else

Run different code depending on a condition, with as many branches as you need.

In this lesson

  1. if: run code only sometimes
  2. else: the other case
  3. elif: more than two cases
  4. Nested decisions