from random import *runs = 100000S = runsfor _ in range(runs): while(randint(1,20) != 1): S += 1print(S/runs)
from random import *
runs = 100000S = runsfor _ in range(runs): while(randint(1,20) != 1): S += 1print(S/runs)
>>> 20.05751
>>> 20.05751