思路:
def new_ton(num): if num == 0: return 0 res = int(sqrt(num, num)) print(res) def sqrt(n, x): cur = (n + x/n) / 2 if cur == n: return cur else: return sqrt(cur, x) if __name__ == '__main__': new_ton(12)