It's too dangerous to go alone! Take this


#1

Can some explain this?

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", "strangeberry", "lint"]

inventory['backpack'].sort()

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

inventory['gold'] = 500 + 50

print inventory

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


#2

strange berry is 2 words


#3

Yup strange berry is indeed 2 words. Also on inventory['gold'] = 500 + 50 you can also do it this way: inventory['gold'] += 50, thats basically saying "add 50 to the current amount"


#4

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