Question: Use python 3, make sure to pass the assert. Implement the function close_to_sqrt (x,y,tol) , which should check whether either number is the square root
Use python 3, make sure to pass the assert.
Implement the function close_to_sqrt (x,y,tol) , which should check whether either number is the square root of the other number. (Specifically, it should return True if x2 is within tol of y or if y is within tol if x.) ## YOUR CODE HERE assert close_to_sqrt (5.0, 25.0) assert not close to_sqrt (2.0, 9.0) assert close_to_sqrt (36.0, 6.0) assert close_to sqrt(49.0, -7.0001, tol-e-2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
