14. It's Dangerous to Go Alone! Take This


#1


Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: invalid syntax (python, line 19)


https://www.codecademy.com/courses/python-beginner-en-pwmb1/2/5?curriculum_id=4f89dab3d788890003000096#


please help! i don't know what i'm doing wrong


this is my code


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'
inventory['pouch'].sort() 

# Your code here
inventory['pocket'] = ['seashell', 'strange berry', 'lint']

inventory['backpack'].sort()
backpack['backpack]'.remove('dagger')

inventory['gold']= inventory['gold'] + 50


#2

Hi,

Just completed this myself

Try changing this to:

inventory['backpack'].remove('dagger')

you've called the key not the dictonary at the start and have the ' outside of the bracket, not closing it.

hope this helps


#3

also put a space before the =


#4

thanks! now it works


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.