Curious fact about euler's number: Pick a uniformly random number in [0,1] and repeat until the sum of the numbers picked is >1. You'll on average pick e numbers!
importrandomimportmath
total = 0
tests = 314159
for n in range(tests):
sum_ = 0
while sum_ <= 1 :
sum_ += random.random()
total += 1
print(total/tests - math.e)
#
# 0.002961236358451913
#