Re: [Tutor] square root

2007-05-28 Thread Alan Gauld

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


[Tutor] square root

2007-05-27 Thread adam urbas
Hi all,I was just wondering how I would go about performing a square root 
thing, for my radiacir.py program.
_
Change is good. See what’s different about Windows Live Hotmail.
www.windowslive-hotmail.com/learnmore/default.html?locale=en-usocid=TXT_TAGLM_HMWL_reten_changegood_0507___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor