Python course · Chapter 5
Making decisions
if, elif, else, comparisons, and / or / not.
Project: cinema ticket prices.
- 5.1True or false?Comparisons ask a question about values, and the answer is always True or False.Start →
- 5.2If this, do thatif runs some lines only when a comparison is True. The colon and the indent show which lines.Open →
- 5.3Else and elifelse covers "otherwise", and elif lets a program choose between more than two paths.Open →
- 5.4And, or, notJoin comparisons together to ask bigger questions.Open →
- 5.5Project: cinema ticket pricesPut the chapter together: work out a cinema ticket price from an age and a day of the week.Open →
- CheckCheckpointFive mixed questions on making decisions, with input, maths and f-strings mixed back in. Pass them all to finish the chapter.Open →