Total Python Noob

shstein2002 at yahoo.com shstein2002 at yahoo.com
Fri Oct 10 02:30:30 EDT 2008


On Oct 9, 11:22 pm, "Tom Lake" <tl... 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?
>
> Tom Lake

do 'from math import sqrt' first

or try '2**0.5'



More information about the Python-list mailing list