Guided Notes

Modules & Packages

import, aliases, from-imports, submodules, pip, and exploring unfamiliar objects.

Importing modules

Slide 1 / 5

A module is a file of Python code — variables and functions — that you load with import.

import math math.pi → 3.141592653589793 math.log(32, 2) → 5.0 math.sqrt(16) → 4.0

Everything in the module is reached with a dot. The standard library — math, random, datetime, json, and hundreds more — comes with Python, no install needed.

← Error Handling