Answer:
def my_sqrt(a):
while True:
x = a
y = (x + a / x) / 2
if (y == x):
break
else:
x = y
print(x)
return 0
my_sqrt(5)
Explanation:
The above is a function in Python, and the exact copy as code of what is being given in the question. Its a method to find out the square root of a number which is a here. The while loop has been used as being mentioned in the question, and the variables are defined and calculated as being stated.