# 14/14 How to Add 50 to the number stored under the 'gold' key?

``````inventory = {
'gold' : 500,
'pouch' : ['flint', 'twine', 'gemstone'], # Assigned a new list to 'pouch' key
``````

}

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’]=50 print inventory

Oops, try again. Make sure to add 50 to the gold total!

1 Like

inventory[‘gold’] = 550

1 Like

inventory = {
‘gold’ : 500,
‘pouch’ : [‘flint’, ‘twine’, ‘gemstone’], # Assigned a new list to ‘pouch’ key
‘pocket’ : [‘seashell’, ‘strange berry’, ‘lint’]
}

# 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’

inventory[‘pouch’].sort()

inventory[‘backpack’].sort()
inventory[‘backpack’].remove(‘dagger’)
inventory[‘gold’] = 500 + 50
print inventory

1 Like

QUESTION:

Why is that ((( inventory [‘gold’] = 500 +50 ))) is written this way and not
this way [ 500 + 50 ]?

Thank you

Syntax error:

File “python”, line 15
inventory[‘gold’]+=50
^
SyntaxError: invalid syntax