I am creating a list with itertools from a list of ranges, as long as I have it:
start_list = [xrange(0,201,1),xrange(0,201,2),xrange(0,201,5),xrange(0,201,10),xrange(0,201,20),xrange(0,201,50),xrange(0,201,100),xrange(0,201,200)]
Now I know that if I tried to run the following line, it would kill my python interpreter:
next_list = list(itertools.product(*start_list))
What interests me is whether it is possible to insert an argument that checks each tuple into the sum of its elements and put them only in next_list if it is equal to a certain sum?
Maybe something like:
next_list = list(itertools.product(*start_list,sum(tuples)=200))
I know this is wrong, and I may have to think about how I do it. Will the start_list range in the generator be too long to go through to create another list?