I'm new to python too, and I'm not sure exactly that I understand what your trying to do.
Is it that there are 10 lists, and each list has 10 items, and each item is effectively a binary choice?
I think you'll want to be using the
itertools module, either import it or just borrow the code you need.
This is an example of the total combinations of 1 list of 10 binary options.
# this code from itertools
# can also be invoked by changing 'combinations' to 'itertools.combinations' in your code
# or by starting with the line 'from itertools import combinations'
def combinations(iterable,r = None):
# combinations('ABCD', 2) --> AB AC AD BC BD CD
# combinations(range(4), 3) --> 012 013 023 123
pool = tuple(iterable)
n = len(pool)
if r > n:
return
indices = list(range(r))
yield tuple(pool[i] for i in indices)
while True:
for i in reversed(range(r)):
if indices[i] != i + n - r:
break
else:
return
indices[i] += 1
for j in range(i + 1,r):
indices[j] = indices[j - 1] + 1
yield tuple(pool[i] for i in indices)
# My example code
n= 0
a = (1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0)
for b in combinations(a,10):
n += 1
print (n,b)
Yields:
Output:
1 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
2 (1, 1, 1, 1, 1, 1, 1, 1, 1, 0)
3 (1, 1, 1, 1, 1, 1, 1, 1, 0, 1)
4 (1, 1, 1, 1, 1, 1, 1, 0, 1, 1)
5 (1, 1, 1, 1, 1, 1, 0, 1, 1, 1)
6 (1, 1, 1, 1, 1, 0, 1, 1, 1, 1)
7 (1, 1, 1, 1, 0, 1, 1, 1, 1, 1)
8 (1, 1, 1, 0, 1, 1, 1, 1, 1, 1)
9 (1, 1, 0, 1, 1, 1, 1, 1, 1, 1)
10 (1, 0, 1, 1, 1, 1, 1, 1, 1, 1)
11 (0, 1, 1, 1, 1, 1, 1, 1, 1, 1)
12 (1, 1, 1, 1, 1, 1, 1, 1, 0, 0)
13 (1, 1, 1, 1, 1, 1, 1, 0, 1, 0)
...
184756 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)