Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 terminateStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started