Write a Python function that computes the square root of anumber. First, guess that the number is 1. Then repeatedly get thenext guess from the last guess by using the following formula: next= 0.5((last + x) / last). Last = last guess, next = next guess.Repeat 10 times using a loop and the 10th guess will be the squareroot. The function compute_sqrt(x) computes the square root of xand returns the square root.
Expert Answer
Answer to Write a Python function that computes the square root of a number. First, guess that the number is 1. Then repeatedly ge…