Track 3 · Lesson 3 of 11
Multi-way decisions with elif
Pick one of many outcomes with if, elif and else, and order the conditions so tiers and brackets come out right.
You will be able to
- Write an if-elif-else chain that picks exactly one of several outcomes
- Explain why Python stops at the first true condition
- Order conditions so that tiered rules (grades, fee bands) work
- Calculate a progressive charge where each band has its own rate
Included with a Formula Quest membership
It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.
View Formula Quest memberships
Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.