9. Removing a few things



There's something wrong with the code on this page.

If I take backpack = ['xylophone', 'dagger', 'tent', 'bread loaf'] and put it into IDLE, I am able to code several difference solutions that make this code work.

No matter which way I put it into Codecademy's interpreter, I can an "Oops" message every time.

Here's my code straight from IDLE:

>>> backpack = ['xylophone', 'dagger', 'tent', 'bread loaf']
>>> backpack.remove('dagger')
>>> print backpack
['xylophone', 'tent', 'bread loaf']

#I also attempted removing additional items using del and it also works
>>> del backpack[1]
>>> print backpack
['xylophone', 'bread loaf']

I believe this particular tutorial is broken.


Have you tried a Browser reset
and give the EXACT Oops-message....

++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser


Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).


backpack is a member of inventory.


tutorial 9.13 not 9.14




So that tutorial doesn't have the word "Inventory" in it.

strangely, however, all I did was hit submit code on it again and magically, it just started working.


3 posts were split to a new topic: Is there a difference between del and remove