It's dangerous to go alone! Take this


#1



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


can't figure out where I am going wrong here to get this error.


    'gold' : 500+50
    'pouch' : ['flint', 'twine', 'gemstone']
    'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']
    '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('backpack') 

backpack.remove('dagger')# Your code here




#2

Is that your whole code?


#3

If it is, you missed the

inventory = {

spot here:
. |
. v

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

It should look like this:
. |
. v

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

#4
                       X            X
              ________________________________                                                                                                                                              
             |                                |                                                                      
             |                                |                                             
             |_                              _|                                                                              
                -___                    ___ -                                                       
                       -_______________-

Hehehehehe Have fun :smiley:


#5

no for some reason my copy and paste missed it. but it is there in my code... I'll redo it again


#6

inventory = {
'gold' : 500+50
'pouch' : ['flint', 'twine', 'gemstone']
'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']
'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('backpack')

backpack.remove('dagger')# Your code here


#7

Gee, I got it here but I did not need to add 50 to the number stored under the 'gold' key.


#8

Use three backticks
aka ` before you put your code please

EDIT: I said you instead of Use!


#9

Here is my code. don't use it, but try to figure out what you got wrong.

inventory = {
'gold' : 500,
'pouch' : ['flint', 'twine', 'gemstone'], # Assigned a new list to 'pouch' key
'backpack' : ['xylophone','dagger', 'bedroll','bread loaf'] ,
'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()
#Your code here

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

Good luck have fun!!
EDIT: Good Luck Have Fun!!
EDIT: EDIT: Good Luck Have Fun!!
EDIT: EDIT: EDIT: Good Luck Have Fun!!
EDIT: EDIT: EDIT: EDIT: Good Luck Have No Fun!


#10
                   X            X
          ________________________________                                                                                                                                              
         |                                |                                                                      
         |                                |                                             
         |_                              _|                                                                              
            -___                    ___ -                                                       
                -__________________-      SUckers

#11

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