I have two lists:
L1 = [[a,b,c],[d,e,f]]
L2 = [1,2]
I want the output to be:
L3 = [[[a,b,c],1], [[d,e,f],2]]
How do I do this?
>Solution :
You can also use a list comprehension, assuming your lists always have equal sizes:
L3 = [[L1[i], L2[i]] for i in range(len(L1))]
print(L3)
Output:
[[['a', 'b', 'c'], 1], [['d', 'e', 'f'], 2]]