Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- runs=10000
- total=0
- for i in range(runs):
- rolls=0
- w=[]
- while True:
- rolls+=1
- w.append(random.randint(1,6))
- if len(w)>6: w=w[1:]
- if w==[1,2,3,4,5,6]:
- total+=rolls
- break
- print(".", end='')
- if(i % 80 == 0):
- print("")
- print(total/runs)
- input()
Advertisement
Add Comment
Please, Sign In to add comment