Written by the Fiveable Content Team • Last updated August 2025
Verified for the 2026 exam
Verified for the 2026 exam•Written by the Fiveable Content Team • Last updated August 2025
Definition
Importing a module in Python allows you to access and use the functions, variables, and classes defined in that module. It enables code reusability and helps avoid writing the same code multiple times.
Module: A module is a file containing Python definitions and statements. It can be used as a library of reusable code.
Function: A function is a block of organized, reusable code that performs a specific task. It helps break down complex tasks into smaller manageable parts.