import random sixes = 0 amount = 10000000 for i in range(amount): dice = random.randint(1, 6) if dice == 6: sixes += 1 print(sixes / i)