In [32]:
import math
c = float(raw_input("Enter c: "))
epsilon = 1e-15
x = 3.0
xn = 4.0
iter = 0
while (abs(xn-x) > epsilon and iter<100):
x = xn
xn = x - (math.log(x) - c)*x
iter = iter+1
print iter
print xn
In [33]:
math.exp(c)
Out[33]:
In [ ]: