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\']]
You can try:
my_list = [['a1','b1'],['a2','b2'],['a3','b3','c3'],['a4','b4','c4','d4','e4']] print(my_list) for each_list in my_list: last_element = each_list[-1] print(last_element)
Code tested successfully to arrive at the expected result - In the Attachment