It's Dangerous to Go Alone! Take This


#1

It gives me an error saying invalid syntax and I don't know how to fix this. I need help!

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

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

inventory['pouch'].sort()

inventory['backpack'].sort()
inventory['backpack'].remove('dagger')
inventory['gold'] += 50

Error says:

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


#2

Ohp sorry nevermind, all I had to do was move the 'pocket' to after the 'backpack' and it worked!


#3

can u plz send me your running code


#4

srryy.dont send it works


#5

hello this is my codehopeit works

inventory = {
'gold' : 500,
'pouch' : ['flint', 'twine', 'gemstone'],
'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']
}

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

inventory['pouch'].sort()

inventory['pocket']=['seashell','strange berry','lint']
inventory['backpack'].sort()
inventory['backpack'].remove('dagger')
inventory['gold']=inventory['gold']+50


#6

Your code is correct. You just missing a "," in your code after the line **'pocket' : ['seashell', 'strange berry', 'lint**'].