import

KeywordPython 2.0+Beginner

Loads a module or package into the current namespace

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
import math
print(math.pi)
print(math.sqrt(144))
print(math.ceil(3.2))

import random
print(random.randint(1, 10))

import os
print(os.name)

import loads a module and makes it available by name. Access its contents with dot notation: module.function().

Try in Playground

Tags

languagesyntaxcoremodulepackage

Related Items