Mar-16-2018, 10:15 PM
Each g in g_values for the minimal code below is being looped through, however when the end of g_values is reached, the outside loop starts again. I can tell this since concat_g_p starts from 2_3 again.
I would like an explanation as to why this happens, and suggestions on what to do to fix it?
Minimal code:
I would like an explanation as to why this happens, and suggestions on what to do to fix it?
Minimal code:
g_values=xrange(2,3) p_values=primes[0:1000] h_values=xrange(2,100) order_false_list=[] for g in g_values: for p in p_values: concat_g_p=str(g)+"_"+str(p) print "concat_g_p is: "+str(concat_g_p) if concat_g_p in order_false_list: break elif g == p: ... else: for h in h_values: if h>=p: #don't want to consider these since solutions of these already dealt with (non-unique) h_solution_found=True break else: ... order_false_list.append(concat_g_p) ...