Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 19 Online
OpenStudy (anonymous):

In the 2011 lecture 3 they make a program that gives you a number that is CLOSE to the square root of a number. How can I make a program in python that finds the exactly square root of any number (int/ float)?

OpenStudy (anonymous):

You could make epsilon extremely small, but to get an exact square root means python has to do ALOT of calculations so it would take a very long time to get anywhere. There is probably a way to do it but in my opinion the best way, if you want a very precise answer is to simply use a very small epsilon. I know im not exactly answering your question but i hope this helps

OpenStudy (anonymous):

or just use the sqrt() function in the math module. http://docs.python.org/library/math.html#math.sqrt

OpenStudy (anonymous):

Thank you both!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!