I have a list of lists. I want to pop() an element say from the second list in the list of lists. Here is an example:
>>> list1=[1,2]
>>> list2=[3,4]
>>> listoflists=[list1, list2]
so, printing listoflists gives me:
>>>listoflists
[[1, 2], [3, 4]]
I want to pop, say, the first element of the second list in listoflists, i.e., 3.
>>>listoflists.pop([1][0])
gives me the following error;
Traceback (most recent call last):
File "<ipython-input-14-db5dc303028d>", line 1, in <module>
listoflists.pop([0][1])
IndexError: list index out of range