import (Python)

The import statement brings code from another module or library into your file so you can use it. You can import a whole module or specific names from it.

Python

Syntax

import module
from module import name

Examples

Python

from random import randint
print(randint(1, 1))

Output:

1

Learn it in a lesson

See also

Back to the Dictionary