Python Forum

Full Version: Permutation help.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What I have is a list of lists. Something like this:
[[1][4][2][3, 6][4][1]]
what I want back is something like:
[1][4][2][3][4][1], [1][4][2][6][4][1]
or even:
['142341', '142641']
How can I accomplish this please? The only ideas I have seem very convoluted.

Thanks :D
itertools:

>>> data = [[1], [4], [2], [3, 6], [4], [1]]
>>> list(itertools.product(*data))
[(1, 4, 2, 3, 4, 1), (1, 4, 2, 6, 4, 1)]