What are modules and packages?

Python modules, packages and environments · Freshers

Model answer

A module is a single .py file you can import. A package is a folder of modules (usually with an __init__.py) that groups related code. Import with import math or from math import sqrt.

Learn this topic

Modules, pip and Virtual Environments in Python in the course Python for Beginners: Learn to Code with Real Projects.

Sign in to add your own answer.

More questions