def f(x): return 7/(3*x)-1 def derivee_f(x): return -7/(3*x**2) def newton(x0,e): x = x0 while abs(f(x))>e: d=derivee_f(x) x = x-f(x)/d return x