Encapsulate the following Python code in a function named my_sqrt that takes a as a parameter, chooses a starting value for x, and returns an estimate of the square root of a.
while True:
y = (x + a/x) / 2.0
if y == x
break
x = y
1
Expert's answer
2019-12-16T05:40:02-0500
def my_sqrt(a):
x = a
while True:
y = (x + a/x) / 2.0ify == x:
breakx = yreturny
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments