0%
⭐ 0 XPPractice
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

  1. Use a for loop with range to print 10 down to 1, one number per line.
  2. 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.

Ask the community

bot.py
Terminal
Next →

Python Warm-ups

All practice packs

Talk it out

  1. Read the instruction with the ✗ out loud.
  2. Say what your code does, line by line, as if to a friend.
  3. Find the line where what it does and what you want split apart.
  4. Press Run and read the terminal. Is that what you expected?
  5. Still stuck? Press Ask Pip why, or peek at the solution.
  6. Or ask on the community help board: say which quest, and paste your code.
New badge!

Your bot just got a new part. See it on the quest map.

Name your bot

It levels up as you play, and gets a new part with every chapter.