Whats Wrong!!!!!!!!!

inventory = {
    'gold' : 500,
    'pouch' : ['flint', 'twine', 'gemstone'], # Assigned a new list to 'pouch' key
    'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']

# Adding a key 'burlap bag' and assigning a list to it
inventory['burlap bag'] = ['apple', 'small ruby', 'three-toed sloth']

# Sorting the list found under the key 'pouch'

# Your code here
inventory["pocket"] = ["seashell", "strange berry", "lint"
del inventory["backpack"["dagger"]] 


Not sure in what way you think it's misbehaving, you have to explain that so that we know what to look for, but on your second last line, you try to use "backpack"["dagger"] as a key, and those are two separate values, a string and a list containing a string and you can't just put two values next to each other without saying how they relate to each other!

Actually I got that wrong, although that part is still incorrect. "backpack"["dagger"] is not two separate values, that is trying to use a string as an indexer to another string. That's not valid, only integers can be used that way, for example: "backpack"[4]

Now I have no idea what the exercise asks you to do, but here's how you can do a few things:
inventory["backpack"] is a list, right? And if you want to remove "dagger" from that list then you can call the remove function on that list, like so:
or if you want to remove at a certain index of that list
del inventory["backpack"][1]
but if it's "dagger" you want to remove, then you won't know what index it is until you've looked at the list, which is why you would use the remove method instead in that case.


I played with both of ionatan suggests and they both will work. Don't forget about the 'gold', I did. Hang in there, this exercise had me going. We will complete this course.