import matplotlib.pyplot as plt import numpy as np debut = 0 fin = 4 pas = 0.1 x = np.arange(debut,fin,pas) f = np.exp(x) plt.plot(x,f,"r") # trace une courbe rouge plt.xlabel('x') plt.ylabel('f(x) = exp(x)') def Euler (h,n): x=0 y=1 Lx=[x] Ly=[y] for i in range(n): x=x+h Lx.append(x) y=y+h*y Ly.append(y) plt.plot(Lx,Ly,"b") plt.show() return(Lx,Ly) Euler(1,4)