Using Modules
Importing functions within a modules
- Syntax: from module_name import function_name
-
from mandelbrot import inMandelbrotSet
p = 1+0.5j
if inMandelbrotSet(p):
print “%f+%fj is in the set” % (p.real, p.imag)
else:
print “%f+%fj is NOT in the set” % (p.real, p.imag)
Importing all the functions within a module
- Syntax: from module_name import *