My purpose is to combine multiple 2d list in order such as:
a = [[1,2],[3,1]] b= [[3,6],[2,9]] c = [[5,1],[8,10]] Expected: [[1,2,3,6,5,1],[3,1,2,9,8,10]] >
You can use zip and a list comprehension:
>>> a = [[1,2],[3,1]] >>> b = [[3,6],[2,9]] >>> c = [[5,1],[8,10]] >>> [x+y+z for x,y,z in zip(a, b, c)] [[1, 2, 3, 6, 5, 1], [3, 1, 2, 9, 8, 10]] >>>