"TypeError: list indices must be integers or slices, not str" is not Understood


Why the error is occurring??

Hi @Odibumba, do check the type of variable word as well as of variable item. The error is due to the indices being passed which are of type β€˜str’. Hope this helps!!

1 Like

It looks like word is a string object, and it cannot be used as an int index, to index an element in the list.
If you want to do that, make line_list a dictionary, and then store the location of Parliament there.

1 Like