Suppose I have two lists
L1 = [1,2,3]
and
L2 = [a,b,c]
Whats the fastest way to convert this to the list M = [(1,a),(2,b),(3,c)]?
I tried M = [(x,y) for x in L1 for y in L2] but this gives me all possible combination of elements. Sure I can write a loop to do it, but is there a more pythonic way to do this?
Use
zip().