Professional Documents
Culture Documents
Python Modules
Python Modules
Python Modules
1) Import statement
2) from Import statement
3) from Import * statement
1) Import modules in Python
• We can import the definitions inside a module to
another module or the interactive interpreter in
Python.
Example:
# import standard math module
import math
import math as m
print(m.pi)
Output: 3.141592653589793
2) Python from...import statement
# import only pi
Output: 3.141592653589793
3) Import all names