Pack 1 · Challenge 1 of 5 · 10 XP · ⏱ 3 min
Countdown
🚀 range() can count backwards too. Give it a third number, the step: range(5, 0, -1) counts 5, 4, 3, 2, 1 and stops just before 0.
for n in range(3, 0, -1):
print(n)3 2 1
Instructions
- Use a
forloop withrangeto print 10 down to 1, one number per line. - After the loop, print
Liftoff!
💡 Hint
range(10, 0, -1) gives 10 down to 1. Print Liftoff! back at the left edge, after the loop.
bot.py
Terminal