Generation

generate functionSun, 13 Nov 2022

average number of trails to obtain all six sides of a dice at least once.

def throw(n): import random trials = 0 while n != 6: n = random.randint(1, 6) trials += 1 return trials throw(1)

Questions about programming?Chat with your personal AI assistant