Sectionย 7. Chapterย 5
ninja.py
index.html
preset.py
Removing item by value
Swipe to show menu
Previously, we removed items from the inventory by index, but itโs also possible to remove items from the inventory by value.
The inventory can contain objects like cat, dog, monkey, chicken, parrot, etc. So, if you want to remove dog from the inventory, you can simply write ninja.inventory.remove("dog").
Task
Swipe to start coding
Solution
Everything was clear?
Thanks for your feedback!
Sectionย 7. Chapterย 5
ninja.py
index.html
preset.py
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat