Unit 2 Task 9: Bus departure countdown

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 2 Task 9 - Bus departure countdown

← Unit 2 tasks · Solution


The bus leaves in N minutes. Ask for a positive integer N. Print N, then N-1, … down to 1, each on its own line (e.g. 5, 4, 3, 2, 1).

Use a for loop. Hint: range can count backwards with a step: range(n, 0, -1).

Skills: for, range.