14/14 what's wrong?


#1


#2

Line 15 should be:

inventory.sort()

#3

But it says ,
File "python", line 15, in
AttributeError: 'dict' object has no attribute 'sort'


#4

@betaninja85731

Double check your code, look at line 14, compare it to line 8. Notice a difference?

If you still need help after this hint ask again.


#5

I see.....Thanks a lot ! > <


#6

hi betaninja85731

I think by now you might be out with the solution by working out with the wrong code.
In case you have not i would like to help you a bit as your fellow mate,This could help our fellow coders for sure.

correct code snippet

never write the code as below as question mentioned notifies a different format as mentioned above but normally below code is also correct.


#7

This Worked

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']

Sorting the list found under the key 'pouch'

inventory['pouch'].sort()

Your code here

inventory["pocket"] = ["seashell","strange berry","lint"]
inventory["backpack"].sort()
inventory["gold"] +=50
inventory["backpack"].remove("dagger")