"Chris Rebert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
On Thu, Oct 9, 2008 at 11:22 PM, Tom Lake <[EMAIL PROTECTED]> wrote:
I have Python 2.6 installed on Vista Ultimate.  When I try to calculate
sqrt (or any transcendental functions) I get the following error

sqrt(2)

Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
NameError: name 'sqrt' is not defined

What am I doing wrong?

They're not buitltin, they're in the 'math' module
(http://docs.python.org/library/math.html#module-math), which you need
to import.
e.g.
import math
print math.sqrt(4)

Please also Read the Fine Tutorial at:
http://docs.python.org/tutorial/index.html

Great!  Thanks so much!

Tom Lake
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to