the-honk/python/calculators/sqrt.py
2021-07-10 12:23:46 +01:00

7 lines
107 B
Python

def sqrt(x):
a = 2
while abs((a - (x / a))) > 1:
a = (a + (x / a)) / 2
return a // 1
print(sqrt(81))