Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Removing item by value | Lists
Python Ninja
course content

Contenu du cours

Python Ninja

Python Ninja

1. Contrôles de Base
2. Contrôles Avancés
3. Fonctions
4. Boucles
5. If-Else Statements
6. Défis
7. Lists

book
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").

Tâche

Swipe to start coding

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 7. Chapitre 5
py

ninja.py

toggle bottom row

book
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").

Tâche

Swipe to start coding

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 7. Chapitre 5
Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Nous sommes désolés de vous informer que quelque chose s'est mal passé. Qu'est-il arrivé ?
some-alt