Here's one solution:
TOL = 0.01
S = 2117519.73
x_old = 2000
while True:
x_new = (x_old + S / x_old) / 2
if abs(x_new - x_old) < TOL:
break
x_old = x_new
print("sqrt({}) by Hero's method: {:.2f}".format(S, x_new))
import math
print('Compare with the "exact" answer:', math.sqrt(S))
The output is:
sqrt(2117519.73) by Hero's method: 1455.17
Compare with the "exact" answer: 1455.1700003779627