I’m having trouble figuring out how to get my program to keep track of the total of the random numbers im generating and getting my program to stop when the numbers add up to a specific value.
for x in range(0,times):
###but maybe a while loop?
table=[0 for i in range (21)]
import random
for d1 in range(21):
if table1[d1]:
table[d1] = random.expovariate(gamma_val)
else:
table[d1] = random.expovariate(1/gamma_val)
mn= min(table) ####selects minimum value of table which i use in rest of program##
###program goes on to do some biology thing###
I would like the loop to end once the total number of mn (minimum numbers selected from table) adds up to a certain value
My crystal ball tells me you want: