๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Python Beginner

What is Module?

A Python file containing definitions and statements that can be imported and reused in other Python programs.

A module is simply a .py file. It can define functions, classes, and variables. Modules promote code reuse and organization. Import with import module_name or from module import function.

Python comes with a rich standard library of modules (os, sys, json, datetime, etc.). Third-party modules are installed via pip. Packages are directories of modules with an __init__.py file.

Related Terms

Python Context Variable
A variable that maintains separate values for each execution context, enabling implicit state passing in async code without global variables.
Virtual Environment
An isolated Python environment that maintains its own set of packages, independent of the system Python installation.
Lambda Function
An anonymous, single-expression function defined inline using the lambda keyword.
Asyncio
A Python library for writing concurrent code using async/await syntax for non-blocking I/O operations.
Python Coroutine
A function defined with async def that can be paused and resumed, enabling concurrent execution without threads.
Dictionary
A built-in data structure that stores key-value pairs with O(1) average lookup time using hash tables.
View All Python Terms โ†’