I'm am fairly new to python but not new to programming. I am using Python version 2.7.5.
I have a list, A
, where each entry contains ('string1', 'string2')
and I have M
of these elements. I have another list, B
,(where each entry also contains ('string1', 'string2')
) that is much smaller then list A
and has N
elements. I want to keep the first N
elements of list A
and get rid of the rest. How would I do that? Any help would be greatly appreciated.