Math, asked by Aadi7462, 1 year ago

Wite a pyhon program to find the square root of a number by newtons method

Answers

Answered by jay1001
0

Hi this is the program, which i feel should work

def nsqrt(n, m):

   app = 0.5 * n

   for i in range(m):

       b = 0.5 * (app + n/app)

       app = b

   return b

print(nsqrt(10, 2))

print(nsqrt(10, 6))

print(nsqrt(10, 7))

 


jay1001: Also, pls check for the indentation
jay1001: as there might be minor mistakes while typing on a non - IDE text writer
Similar questions