14/14 Any idea what is wrong?


#1

inventory = {
'gold' : 500,
'pouch' : ['flint', 'twine', 'gemstone'], # Assigned a new list to 'pouch' key
'backpack' : ['xylophone','dagger', 'bedroll','bread loaf'],
'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()
backpack.remove('dagger')
inventory['gold'] + 50

I get the error : Name 'backpack' is not defined, I did not mess with it and I have tried restarting it a few times, any idea what is wrong?


#2

Backpack itself isn't defined, but there is a key in inventory called 'backpack'. You need to access backpack via inventory like you did here:

inventory['backpack'].sort()

14/14 Any idea about what I am doing wrong?
#3

Thank you! Appreciate the help!


#4

Welcome! :slightly_smiling: