Apr-26-2021, 11:15 AM
This is my list:
How can I do that?
list_of_lists = [[1, 2], [3, 4]]I want to group of elements of sublists:
list_of_lists = [[1, 2], [3, 4]] n=[] for list in list_of_lists: n.append(list[0]) #I am taking 1 and 3 n.append(list[1]) # I am taking 2 and 4But sometimes I can have 100 elements too so I want to do it dynamically instead of writing [0],[1]
How can I do that?