call this function
def test_sqrt():
a = 1
while a < 26:
print('a =', a,'| my_sqrt(a) =',my_sqrt(a),'| math.sqrt(a) =', math.sqrt(a),'| diff =', abs(math.sqrt(a)-my_sqrt(a)))
a = a + 1
return 0
import math
def test_sqrt():
  a = 1
  while a<26:
    print('a =', a,'| my_sqrt(a) =',my_sqrt(a),'| math.sqrt(a) =', math.sqrt(a),'| diff =', abs(math.sqrt(a)-my_sqrt(a)))
    a = a + 1
  return 0
if __name__ == "__main__":
  test_sqrt()
my_sqrt() is user defined function which user didn't added in question. This code is running once user will add my_sqrt() function defined by him. Method calling is fine which is asked in question.
Comments
Leave a comment