Before you start
Inventory command reference · Week 5
Your editor starts empty. The hero is already available; no import is needed. Write your own plan.
hero.collect()Pick up the items on your tile. Each item joins the end of your inventory. Coins are counted separately.
hero.inventory[index]Read an item at its current position. The first index is 0. Empty slots have no item.
hero.equip(hero.inventory[index])Replace index with the position you want. Hold that collected item. Walking carries your whole inventory.
hero.drop()Leave the held item on your tile. Later items shift left. Collect it again to add it to the end.
print(hero.inventory)
len(hero.inventory)Inspect the current list or count its items. Up to five items fit. Read hero.inventory again after collecting, using, or dropping an item.
Hold a matching colored key to unlock a door, a sword to attack, or a potion to heal. A used key or potion leaves the list; the sword stays.
Need a hint?
Loading Python…
Level complete!
You finished every goal.
Read the map
Write your moves, then press Run.