Total Python Noob

Tom Lake tlake at twcny.rr.com
Fri Oct 10 02:52:23 EDT 2008


"Chris Rebert" <clp at rebertia.com> wrote in message 
news:mailman.2304.1223620458.3487.python-list at python.org...
> 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

Great!  Thanks so much!

Tom Lake 




More information about the Python-list mailing list