| Hosted by CoCalc | Download
Kernel: Python 3 (system-wide)
import random
listt=[] stat=0 def spin(): if total < 100 and total >85: return 1 else: return 0 #print(num1,num2,total) for i in range(1000): num1= random.randrange(0,101,5) num2= random.randrange (0,101,5) total=num1+num2 listt.append(spin()) for u in listt: stat=stat+u length=len(listt) #print(listt,stat,length) print(stat/length)
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 11 100 0.11