What is the fastest and most elegant way of doing list of lists from two lists?
I have
In [1]: a=[1,2,3,4,5,6] In [2]: b=[7,8,9,10,11,12] In [3]: z
List comprehension would be very simple solution I guess.
a=[1,2,3,4,5,6] b=[7,8,9,10,11,12] x = [[i, j] for i, j in zip(a,b)] print(x) output : [[1, 7], [2, 8], [3, 9], [4, 10], [5, 11], [6, 12]]