from random import randint
from matplotlib.pyplot import axis, plot, show, axhline

L = [] # liste des fréquences
delta = 1/10
p = 1/6
count = 0

for _ in range(200):
    n = 0
    for _ in range(100):
        face = randint(1, 6)
        if face == 1: # si face est "1"
            n = n + 1
            
    L.append(n/100)
    if (p-delta <= n/100 <= p+delta):
        count += 1

print( count/200 )
axis([0,200,0,0.5])
plot(L, marker='+', linestyle='')
# Ajout des lignes horizontales
axhline(y=p-delta, color='r', linestyle='--')
axhline(y=p+delta, color='r', linestyle='--')
show()

