Python course · Chapter 5

Making decisions

if, elif, else, comparisons, and / or / not.

Project: cinema ticket prices.

  1. 5.1True or false?Comparisons ask a question about values, and the answer is always True or False.6 steps · about 20 minutes · 0 of 3 challenges passedStart →
  2. 5.2If this, do thatif runs some lines only when a comparison is True. The colon and the indent show which lines.6 steps · about 20 minutes · 0 of 3 challenges passedOpen →
  3. 5.3Else and elifelse covers "otherwise", and elif lets a program choose between more than two paths.6 steps · about 20 minutes · 0 of 3 challenges passedOpen →
  4. 5.4And, or, notJoin comparisons together to ask bigger questions.6 steps · about 20 minutes · 0 of 3 challenges passedOpen →
  5. 5.5Project: cinema ticket pricesPut the chapter together: work out a cinema ticket price from an age and a day of the week.4 steps · about 15 minutes · 0 of 2 challenges passedOpen →
  6. CheckCheckpointFive mixed questions on making decisions, with input, maths and f-strings mixed back in. Pass them all to finish the chapter.1 steps · about 15 minutes · 0 of 5 challenges passedOpen →