pow() works but sqrt() not!?

tonisk metsakuri at gmail.com
Thu Jan 4 10:35:38 CET 2007


> >if you want math functions to your current namespace use:
> >>> from math import *What is a "namespace" and what is the difference between ">>>import math"
> and ">>>from math import *" ?

for namespaces read this
http://www.network-theory.co.uk/docs/pytut/tut_68.html

import math creates new namespace "math" for names in that module, so
you can acess them by prefixing them with "math", like math.sqrt(9).
from math import * imports all names to your local scope, so you do not
have to prefix them, sqrt(9)

-- 
Tõnis




More information about the Python-list mailing list