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
How about this?
>>> def list_(*args): return list(args) >>> map(list_, range(5), range(9,4,-1)) [[0, 9], [1, 8], [2, 7], [3, 6], [4, 5]]
Or even better:
>>> def zip_(*args): return map(list_, *args) >>> zip_(range(5), range(9,4,-1)) [[0, 9], [1, 8], [2, 7], [3, 6], [4, 5]]