from math import exp for p in range(3,15): h=10.0**(-p) approx=(exp(1+h)-exp(1-h))/(2*h) print(p) print(approx) print(abs((approx-exp(1))/exp(1)))