For example, for code like this
from itertools import product
lst = [[1,2], [2,3], [4,5,6]]
for i in product(*lst):
print(i)
I get
(1, 2, 4)
(1, 2, 5)
(1, 2, 6)
(1, 3, 4)
(1, 3, 5)
(1, 3, 6)
(2, 2, 4)
(2, 2, 5)
(2, 2, 6)
(2, 3, 4)
(2, 3, 5)
(2, 3, 6)
but I would like to get
(1, 2, 4)
(1, 2, 5)
(1, 2, 6)
(1, 3, 4)
(1, 3, 5)
(1, 3, 6)
(2, 3, 4)
(2, 3, 5)
(2, 3, 6)
Tell me how this can be done using itertools.
question from:
https://stackoverflow.com/questions/65651485/how-to-get-product-without-repeating-elements