My question is quite simple, I have a list of lists :
my_list = [[\'a1\',\'b1\'],[\'a2\',\'b2\'],[\'a3\',\'b3\',\'c3\'],[\'a4\',\'b4\',\'c4\',\'d4\',\'e4\']]
An alternative with map:
map
last_items = map(lambda x: x[-1], my_list)
or:
from operator import itemgetter print map(itemgetter(-1), my_list)