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


#1




i dont know whats missing please help me

Oops, try again. It looks like you do not have all the correct items in inventory["pocket"].


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() 

inventory['pocket'] = ['seashell', 'strange berry', 'lint'],
inventory['backpack'].sort()
inventory['backpack'].remove('dagger')
inventory['gold'] = 550
print inventory


#2

Your 'pocket' list must be inside the 'inventory'- dictionary.

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

#3

Take "," out from this line
"inventory['pocket'] = ['seashell', 'strange berry', 'lint'],"

inventory['gold'] += 50


#4

I think it has been added in the correct way , We can add further keys by doing this


#5

worked for me. thank you:slight_smile:


#6

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