Answers for "cartesian product of a list python"

0

cartesian product of a list python

import itertools

somelists = [
   [1, 2, 3],
   ['a', 'b'],
   [4, 5]
]
for element in itertools.product(*somelists):
    print(element)
Posted by: Guest on July-11-2021

Code answers related to "cartesian product of a list python"

Python Answers by Framework

Browse Popular Code Answers by Language