This is the problem already. I do not want to write these variables by hand!
Probably I could not explain my problem to you
I just want to do these 2 line dynamically:
Ok I am writing from the beginning
This is my code for number 2:
Probably I could not explain my problem to you
I just want to do these 2 line dynamically:
a,ap,b,bp= variables[0],variables[1],variables[2],variables[3] finallist = [(a,b),(a,bp),(ap,b),(ap,bp)]These a ap b bp are coming from this line
for variables in itertools.product([0, 1], repeat=(number*2)): # set of variables for a,ap,b,bp,c,cp like 000000 000001 000011...."variables" includes actually a ap b bp...
Ok I am writing from the beginning
This is my code for number 2:
number = 2 for variables in itertools.product([0, 1], repeat=(number*2)): # set of variables for a,ap,b,bp,c,cp like 000000 000001 000011.... a,ap,b,bp= variables[0],variables[1],variables[2],variables[3] finallist = [(a,b),(a,bp),(ap,b),(ap,bp)]THis is my code for number 3
number = 3 for variables in itertools.product([0, 1], repeat=(number*2)): # set of variables for a,ap,b,bp,c,cp like 000000 000001 000011.... a,ap,b,bp,c,cp= variables[0],variables[1],variables[2],variables[3],variables[4],variables[5] #giving value for a,ap,b,bp,c,cp finallist = [(a,b,c),(a,b,cp),(a,bp,c),(a,bp,cp),(ap,b,c),(ap,b,cp),(ap,bp,c),(ap,bp,cp)]THis is my code for number =4
number = 4 for variables in itertools.product([0, 1], repeat=(number*2)): # set of variables for a,ap,b,bp,c,cp like 000000 000001 000011.... a,ap,b,bp,c,cp,d,dp= variables[0],variables[1],variables[2],variables[3],variables[4],variables[5] ,variables[6],variables[7]#giving value for a,ap,b,bp,c,cp finallist = [(a,b,c,d),(a,b,c,dp),(a,b,cp,d),....]#I am not writingAnd I am looking for a way to create finallist dynamically