0

I have list in Python:

A = [[1, 2], [3, 5], [6]]

Currently I am trying: Outlist = [(x, y, z) for x in A[0] for y in A[1] for z in A[2]]

I want to get the output as follows.

Outlist = [(1, 3, 6), (1, 5, 6), (2, 3, 6), (2, 5, 6)]

Can someone help me with better way to do the above.

Thank you so much

0 Answers0