I need some help


#1



Hello
I have a problem, i don't now how to do the 5º exercise of the link below.

https://www.codecademy.com/courses/python-beginner-en-pwmb1/2/5?curriculum_id=4f89dab3d788890003000096#

The error says:
Traceback (most recent call last):
File "python", line 19, in
AttributeError: 'int' object has no attribute 'add'


I'm not sure if the last line is correct. Please help me!
If I have to change the last line, I have the rest of the code right??
Thanks for the help


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']
inventory['pocket'] = ['seashell','strange berry','lint']
# Sorting the list found under the key 'pouch'
inventory['pouch'].sort() 

# Your code here
inventory["backpack"].sort()
inventory["backpack"].remove('dagger')


    #05.Add 50 to the number stored under the 'gold' key
inventory['gold'].add(50)


#2

nice try, but you will have to update the dictionary value slightly different. You can use the same technique as for a normal variable:

variable = variable + 50

hopes this helps


#3

Works perfect!! Thanks!


#4