for x in zip([1,2],[4,5]):
print(x)
(1, 4)
(2, 5)
The disadvantage is that it can only be the same length .
from itertools import product
for x in product([1,2],[3],[4,5]):
print(x)
(1, 3, 4)
(1, 3, 5)
(2, 3, 4)
(2, 3, 5)
much , I don't know how to realize it , If I were , I can only write 3 Regroup .