Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedadd 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions