from random import random

def monte_carlo(n):
    S=0
    for k in range(n):
        x = random()
        y = random()
        if x*x+y*y <= 1:
            S=S+1
    return S/n


#Exécution de la fonction
print(monte_carlo(100))
print(monte_carlo(10000))
print(monte_carlo(1000000))


