adam urbas [EMAIL PROTECTED] wrote
Hi all,I was just wondering how I would go about
performing a square root thing, for my radiacir.py program.
There is a sqrt function in the math module.
import math
print math.sqrt(9)
Math has a lot of other common mathematical functions
in it too - logs, trigonometry etc
Or you can use the builtin pow() function to raise the value
to the power 0.5
print pow(9,0.5)
or use exponentiation:
print 9 ** 0.5
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor