Unusual permutations
<p>I have few lists:</p>

<pre><code>a = [1,2,3]
b = [4,5,6]
c = [7,8,9,10]
</code></pre>

<p>How do I generate all combinations like:</p>

<pre><code>a[0], b[0]
a[1], b[1]
a[2], b[2]
a[0], b[0], c[0]
a[1], b[1], c[0]
a[2], b[2], c[0]
a[1], b[1], c[1]
a[2], b[2], c[2]
a[0], b[0], c[3]
a[1], b[1], c[3]
a[2], b[2], c[3]
.....
</code></pre>

<p>There can be only one value at a time from each list.</p>

<p>Imagine two or more lists Like a=[1,2,3] and b=[4,5,6] and c=[7,8,9] and I would like all possible pairs like (a[0], b[0]),(a[1], b[1]), (a[0], b[0], c[0])... </p>

<p>Not sure whether I've understood correctly your question, but do you mean this?</p>

<pre><code>from itertools import permutations

my_list = ['a1', 'a2', 'a3', 'b1', 'b2', 'c1']

for i in range(len(my_list)):
    print(list(permutations(my_list, i)))
</code></pre>

python algorithm combinations permutation