I have a dictionary like this:
inventory = {'gold' : 500,
'pouch' : ['flint', 'twine', 'gemstone'],
'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']}
How can I remove the dagger from it ?
I tried this:
inventory["backpack"][1].remove()
or
del inventory["backpack"][1]
but It made this error:
Traceback (most recent call last):
File "python", line 15, in <module>
TypeError: 'NoneType' object has no attribute '__getitem__'