14/14- I don't know where i am going wrong


#1

Hello. I have tried many times with this, but i keep getting this error message thrown at me:

  File "python", line 3
    'pouch' : ['flint', 'twine', 'gemstone'], # Assigned a new list to 'pouch' key
          ^
SyntaxError: invalid syntax

I don't know where i am going wrong. Please help me. The code is down below. Thank you in advance.

inventory = {
'gold' : 500, 50
'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['pocket'] = ['apple', 'small ruby', 'three-toed sloth']

# Sorting the list found under the key 'pouch'
inventory['pouch'].sort() 

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

#2

inventory = {
'gold' : 500,
'pouch' : ['flint', 'twine', 'gemstone'], # Assigned a new list to 'pouch' key
'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']
}


#3

You need to add 50 to the gold total. Not to the list.

Since the gold value is an integer and not in a list we need to do the following instead of what they do in the example.

inventory['gold'] = inventory['gold'] + 50

Or I've seen a lot of people use

inventory['gold'] += 50

#4

Thank you very much. This solved my problem :smiley:


#5

Thank you. This helped solve another error :smiley:


#6

you helped me mate! thanks in advance!


#7

you must remove number 50 from "gold : 500, 50". you already put it here "inventory['gold'] += 50". if you know what I mean.