A module in Python is simply a file with a .py extension, containing Python code (functions, classes, variables), which can be imported and used in other programs. Modules help: Creating a module in Python is very simple — just write code in a file with a .py extension: Let's create a mymath.py file: Module with mathematical functions. Python is one of the most popular programming languages because of its vast collection of modules which make the work of developers easy and save time from writing the code for a particular task for their program. Python provides various types of modules which include Python built-in modules and external modules . In this article, we will learn about the built-in modules in Python and how to use them. In Python , a module is a self-contained Python file that contains Python statements and definitions, like a file named GFG.py, can be considered as a module named GFG which can be imported with the help of import statement. However, one might get confused about the difference between modules and packages. A package is a collection of modules in directories that give structure and hierarchy to the modules .

Available

Product reviews

Rating 4.5 out of 5. 8,008 reviews.

Characteristics assessment

Cost-benefit

Rating 4.5 out of 10 5

Comfortable

Rating 4.3 out of 5

It's light

Rating 4.3 out of 5

Quality of materials

Rating 4.1 of 5

Easy to assemble

Assessment 4 of 5