Hint for Remove a few thing Hint


There is a hint for Remove a Few Things(Python Lists and Dictionaries):

You can use list functions with a list stored in a dictionary as follows:
This should help you delete 'dagger' from the list of items stored under the 'backpack' key.

I've tried this:

backpack = ['xylophone', 'dagger', 'tent', 'bread loaf']

,but it doesn't work, showing an error:

Traceback (most recent call last):
 File "python", line 2, in <module>
TypeError: list indices must be integers, not str

Could someone explain me how should dict_name['list_key'].list_function() work, please?


@rikitikitavi69: In fact the hint was abit unclear.
When we say:


The term list_function() will just be any possible function that we can use to handle lists.
So far I haven't seen, nor used, any function called list_function(), unless I wrote it myself.


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