Dec-02-2018, 04:01 PM
One thing:
in the following code:
did you mean for the return to be part of the if==outcome statement? if so indent.
in the following code:
def prob_die(max_exp, outcome): counter = 0 for _ in range(max_exp): s = random.randint(1,6) # roll if s==outcome: counter +=1 return counter/max_expThe for loop is worthless as stands because you return unconditionally after the first iteration
did you mean for the return to be part of the if==outcome statement? if so indent.