First Program Bug (Newbie)

Andreas Tawn andreas.tawn at ubisoft.com
Wed Mar 19 06:34:02 EDT 2008


[snip]
>> What is the square root function in python?
>
> There's one in the math module. Use the one in gmpy if you have it.

Or raise to the power 1/power

>>> 9**(1.0/2)
3.0

Also works for cube root, quad root etc.

>>> 27**(1.0/3)
3.0

>>> 81**(1.0/4)
3.0

>>> 243**(1.0/5)
3.0

Cheers,

Drea



More information about the Python-list mailing list