Newbie simple question - can't find answer

Kiss, Arpad AKiss at GEOMETRIA.hu
Tue Jan 11 10:57:00 EST 2000


<eleisonme at juno.com> wrote in message news:<85fhha$6js$1 at nnrp1.deja.com>...
> Hello all,
> I am using Python 1.5.2-7 on intel Red Hat Linux 6.1.
> I do not seem to be able to use any of the math or cmath functions
> either in a script or on the python command line.
> 
> For example if I type:
> >>>import math
> >>>exp (4)
> 
> OR
> 
> >>>exp(4)
> 
> I get a traceback error:
> NameError: exp (or any other math function that I try to use).
> 

Try: math.exp(4) 
If you want use exp(4) instead of math.exp(4) then use this format of
import:
from math import *
The documentation describes how you can import and what are the differences
between them.

Arpad




More information about the Python-list mailing list