0%
⭐ 0 XPMap
Chapter 5 · Quest 1 of 5 · 10 XP

To-Do Boss

📋 Big goals are scary. Agents break them into steps first. Ask Pip for a plan and you get a list back:

import pip
print(pip.plan("plant a tree"))
['dig a hole', 'plant the seed', 'water it']

enumerate() counts for you as you loop. Start it at 1 and you get numbered steps:

for n, step in enumerate(["wake up", "eat"], 1):
    print(n, step)
1 wake up
2 eat

Instructions

  1. Store pip.plan("bake a cake") in steps.
  2. Print each step numbered like 1. buy flour, using enumerate.
  3. After the list, print 3 steps to go! using len(steps).
💡 Hint

for n, step in enumerate(steps, 1): print(str(n) + ". " + step). Then, outside the loop, print(str(len(steps)) + " steps to go!").

Ask the community

bot.py
Terminal
← BackNext →

Chapter 5: Loops and Plans

The full quest map

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.