from random import randint s=0 for k in range(100): d=randint(1,6) if d==3: s=s+1 f=s/100 print(f)