Question: add the complete code (python) Create a function that takes in a positive number and return 2 integers such that the number is between the
add the complete code (python)
Create a function that takes in a positive number and return 2 integers such that the number is between the squares of the 2 integers. It returns the same integer twice if the number is a square of an integer. Examples >>> sqApprox (2) (1, 2) >>> sqApprox (4) (2, 2) >>> sqApprox (5.1) (2, 3) 10 pt i def sqApprox (num): 2 i = 0 3 minsa maxsq = while i : if i*i=num and i maxsq: 9 maxsq = i 10 i 11 return (minsq, maxsq) OUWP # set lower bound # set upper bound # set 'while' termination condition # complete inequality condition # complete inequality condition # update i so that 'while' will terminate
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
