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


#1

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['pouch'].sort() 
inventory['backpack'].sort()
inventory['backpack'].remove["dagger"]
inventory['gold'] += 50;


#2

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.


#3

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'


#4

can i seen updated version of your code?


#5

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!


#6