Update variables.py

This commit is contained in:
Daniel
2022-12-14 12:24:50 +02:00
committed by GitHub
parent dfbdc4563c
commit 6b8217b50f

View File

@@ -1 +1,12 @@
import random
ans, n = 0, 100000
for i in range(n):
x, j = random.uniform(0, 1), 0
while True:
y = random.uniform(0, 1)
if y > x:
break
j += 1
ans += j
print(ans/n)