this is probably a dumb question so I'll keep it as simple as possible.
I am have a list of varying number of lists (x) and I'm trying to pass each list to the function itertools.product(), but I can't get it to work.
x = [[a, b, c], [d, e, f], [g, h, i]]
itertools.product(x[0], x[1], x[2]...)
I have tried:
itertools.product(x[n] for n in range(len(x)))
itertools.product(n for n in x)
My function would hopefully behave:
output = []
for product in itertools.product(x[n] for n in range(len(x))):
output.append(product)
output """--> [(a, d), (a, e)...]"""
Thanks so much in advance.