Skip to content Skip to sidebar Skip to footer

Outputting All Possible Permutations Of Multiple Lists

I am very new to Python and have only just bought my first 'Crashcourse in Python' book - originally my choice of language was PHP. My Objective: I desire a script that will output

Solution 1:

>>> import itertools
>>> s = [List1, List2, List3, List4, List5]
>>> n = list(itertools.product(*s))
>>> len(n)
10174464

itertools.product -> Roughly equivalent to nested for-loops in a generator expression.


Post a Comment for "Outputting All Possible Permutations Of Multiple Lists"