Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
def fixed_point_iteration():
x = 1.0
for i in range(2): # (1)
x = (x + 3)**0.5 # (2)
return x # (3)
(2) the formula for g(x) is incorrect.
(3) the function returns x1 instead of x2.
(1) the loop runs only once due to range(2).
There is no error; the code is correct.
The loop should use while instead of for.
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!