import random import matplotlib.pyplot def math_plot(xListe,yListe,titre) : matplotlib.pyplot.plot(xListe,yListe) matplotlib.pyplot.title(titre) matplotlib.pyplot.show() def lancer() : de = random.randint(1, 6) if (de < 2) : de = 1 else : if (de < 5) : de = 2 else : de = 4 return de def algo(n) : Y = [] X = [] total = 0 for k in range(1,int(n + 1)): total = total + lancer() X.append(k) Y.append(total/k) math_plot(X,Y,'grands nombres') algo(500)