What Are Modules And Packages In Python?

What Are Modules And Packages In Python?

Published on October 09 2023

In this tutorial, we will learn about Python modules and packages. And will also see what are available built-in modules in Python in detail. This tutorial is part of Python's top 25 most commonly asked interview questions.

Definition

  • Modules
    • Python modules can be simple Python file that contains functions, classes, or variables.
    • is a .py file containing executable code.
  • Packages
    • to organize all the modules we have the Package in Python.
    • collection of different sub-packages or modules with an __init__.py File

Commonly used built-in modules

To know about it, please refer to the official documentation website - official website.