Finish the countdown
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
This one builds on a lesson you haven't finished yet. Do that lesson first:
Python Basics · Counting loops →
Finish the countdown
The loop prints count, but nothing ever changes it — so it would never end. Add the one line that takes 1 off count, inside the loop.
A while loop keeps going for as long as its question is true. Something inside it has to move count towards 0, or the answer stays True for ever. That line is indented under the while, like the print above it.
The loop prints count, but nothing ever changes it — so it would never end. Add the one line that takes 1 off count, inside the loop. It should print 3, 2, 1.
Click Run to see the output here.