14.Its dangerous

python

#1

What am i doing wrong here:
inventory['pocket']
inventory['pocket'] = ['seashell', 'strange berry', 'lint']
backpack.sort()
backpack.remove('dagger')
inventory['gold'] = 50
It says: ops, try again. Check for keys without values or misspelled keys!


#2

instruction step 1 and 2 should be combined, which you did here:

inventory['pocket'] = ['seashell', 'strange berry', 'lint']

so this line:

inventory['pocket']

is no longer needed, remove it.

backpack is part of the inventory dictionary, so if you want to access it you need inventory['backpack']

you add 50 gold, not set the value to 50 gold


#3

Yeah, also, when you are removing the dagger from your list, use which will help you delete dagger from your 'pocket'

dict_name['backpack'].list_function(backpack.remove('dagger'))


#4

i was hoping the learner would get this insight himself after reading this:

If you realize it yourself, it is so powerful


#6