Not entirely sure, do I need to list my lists?


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'

# Your code here

inventory['pocket'] = ['seashell' , 'strange berry' , 'lint']
'gold' + 50

error code:

Traceback (most recent call last):
File "python", line 17, in
AttributeError: 'str' object has no attribute 'remove'


backpack is part of the inventory dictionary. here you do it right:


you use backpack as key to access the dictionary, yet here:


you forget inventory, same for the gold on the line below


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