Cant get right output!


Its Dangerous to go alone ! Take This

Error : Did you sort inventory['backpack']

The code should be accepted and take me forward to the next topic !

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['pocket']=['seashell','strange berry','lint']


Remove this two lines.

Instead, you need to add 50 to the inventory of gold, like this:

inventory['gold'] += 50;



Thanks . It works finally :slight_smile:


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