Exercise 14 · Chapter: ListsOptional+50 XP
Coin Quest: The Backpack
🪙 The hero's backpack starts with a "sword" and a "shield".
- The hero finds a
"potion"— append it - The sword breaks — remove
"sword" - Print the bag
Expected output
['shield', 'potion']
Need a hint?
3 available · costs 5 XP each
python
Output
Run your code to see the output here.