Зміст курсу
Python Ninja
Python Ninja
1. Основні Елементи Управління
Removing item by value
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")
.
Завдання
Swipe to start coding
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 7. Розділ 5
ninja.py
Removing item by value
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")
.
Завдання
Swipe to start coding
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 7. Розділ 5