14. its dangerous


#1

Code not working, error in the last line, any suggestions why?

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

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['backpack'].sort()
inventory['backpack'].remove('dagger')
inventory['gold'].remove(0)


#2

We are to add 50 to the value of inventory['gold'].


#3

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