7/14- why doesn't it work?


#1

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


#2

Hey @vanalin,

Remember, backpack is also in inventory:


Also, this is level 14/14, not 7/14. :smiley:

And there's also another problem, though:

In this, you aren't supposed to append 50 in gold, but add 50 into gold. You remember '+='? Well, that's what you have to use in this situation. :smiley:


#4

Thank you very much! I would stuck there three days without you!


#5

+=, I never thought of it.... Thanks man.