Total Python Noob
Chris Rebert
clp at rebertia.com
Fri Oct 10 02:27:57 EDT 2008
On Thu, Oct 9, 2008 at 11:22 PM, Tom Lake <tlake at twcny.rr.com> 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
Cheers,
Chris
--
Follow the path of the Iguana...
http://rebertia.com
>
> Tom Lake --
> http://mail.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list