x=2
for i in range(100):
xnew = x - (x*2 - 2)/(2x)
if abs(xnew - x) < 0.001: break
x = xnew
print("the poot is %.100f at %d iterations." % (xnew, i))
x=2
for i in range(100):
xnew = x - (x*2 - 2)/(2x)
if abs(xnew - x) < 0.001: break
x = xnew
print("the poot is %.100f at %d iterations." % (xnew, i))
Embark on a journey of academic success with Legit Writing. Trust us with your first paper and experience the difference of working with world-class writers. Spend less time on essays and more time achieving your goals.
Order Now