AI engineering glossary · Python core

What is import statement?

import statement (also called from-import): The statement that loads a module and makes its contents available. Use import math, import math as m, or from math import sqrt. Python caches loaded modules, so a repeated import does not reload the file.

Level: beginnerTopic: Python core

import statement: an example

import math then math.sqrt(16) gives 4.0; from math import sqrt lets you write sqrt(16).

Related terms

More Python core terms

Where you learn it

import statement is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.