It's Dangerous to Go Alone! Take This - Problem


Hello, I just cannot see what is wrong here, please someone tell me.

The error says:

File "python", line 4
'backpack' : ['xylophone', 'dagger', 'bedroll', 'bread loaf']
SyntaxError: invalid syntax

inventory = {
    'gold' : 500,
    'pouch' : ['flint', 'twine', 'gemstone']
    'backpack' : ['xylophone', 'dagger', 'bedroll', 'bread loaf']
    'pocket' : ['seashell', 'strange berry', 'lint']

inventory['burlap bag'] = ['apple', 'small ruby', 'three-toed sloth']

inventory['gold'] += 50;


look here:

'gold' : 500,

you have a , at the end of your line, this separates the key + value pairs, now look here:

'pouch' : ['flint', 'twine', 'gemstone']

, is missing to separate this key + value pair.


I fixed that, but now I get yet another error:

Traceback (most recent call last):
File "python", line 12, in
TypeError: 'builtin_function_or_method' object has no attribute 'getitem'


can i seen updated version of your code?


I just realized that this other error was due to [] brackets around "dagger" instead of these ones (). What a stupid mistake. Now it all works fine. Thanks for your help, stetim94!