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

Course Content

Python Ninja

Python Ninja

1. Basic Controls
2. Advanced Controls
3. Functions
4. Loops
5. If-Else Statements
6. Challenges
7. Lists

book
Removing item by index

You can access the ninja's inventory by writing ninja.inventory, and operate on it using various methods.

For example, if you want to remove an item from your inventory, you can use the pop(index) method. This will delete and return the item at the specified index, or the last item if index is omitted.

Task

Swipe to start coding

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 7. Chapter 4
py

ninja.py

toggle bottom row

book
Removing item by index

You can access the ninja's inventory by writing ninja.inventory, and operate on it using various methods.

For example, if you want to remove an item from your inventory, you can use the pop(index) method. This will delete and return the item at the specified index, or the last item if index is omitted.

Task

Swipe to start coding

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 7. Chapter 4
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt