Beginner question

Kragen Sitaker kragen at pobox.com
Fri May 17 03:21:00 EDT 2002


"Mats Holmberg" <mats.holmberg at welho.com> writes:
> >>>import math
> >>>cos(10)
> Traceback (most recent call last):
>   File "<pyshell#4>", line 1, in ?
>     cos(10)
> NameError: name 'cos' is not defined

from math import cos

There's also "from math import *", which is probably OK for the math
module, but dodgy other times.




More information about the Python-list mailing list