Error in lesson (It's Dangerous to Go Alone! Take This)


Dear Sir,
I just got error again on this below code. I did all correct code but it gives me add value 50 to key "gold" which i did. But still it gives me error.......(Oops, try again. Make sure to add 50 to the gold total!)

Below is my Code

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"]

Thank to help me on this issue also please. I just use these code which are working in workplace but codecademy workplace didn't accept my code.So, thank to help as usual.

My regards,


'gold' has a value, 500. We need to add 50...

inventory['gold'] += 50


Thank you boss. It works for me. I think wrong concept. Sorry, to brother you.



Mine keeps saying:
File "python", line 3
'gold' : [500]
SyntaxError: invalid syntax

What's invalid?


Not enough information for us to indicate what the actual error is. We should note, though, that the value is a number, not a list.

'gold': 500,


yeah that was the problem, thanks.


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