Have you read the itertools documentation?
>>> import itertools >>> l = [('1','11'),('2','22'),('3','33')] >>> list(itertools.product(*l)) [('1', '2', '3'), ('1', '2', '33'), ('1', '22', '3'), ('1', '22', '33'), ('11', '2', '3'), ('11', '2', '33'), ('11', '22', '3'), ('11', '22', '33')]
source share