Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 21 Online
OpenStudy (anonymous):

I'm stuck into the 1.4 exercise when it asks me to print some equation. How can I do the square root operation correctly in python?

OpenStudy (zeeporo):

First you have to "import math" in order that you can call the square root function "math.sqrt(number)". Or you can try to squaring to the broken-number 1/2. "number ** (0.5)"

OpenStudy (anonymous):

Perfect! Thx! :D

OpenStudy (anonymous):

or you can also do with negative number "number**(-2)"

OpenStudy (anonymous):

@zlatandebian number**(-2) is equivalent to : \[\frac{ 1 }{ number ^{2} }\] Not the square root.

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!