Simply, a module is a file consisting of Python code. A module can define functions, classes and variables. We use modules to break down large programs into small manageable and organized files. Furthermore, modules provide reusability of code and make the code easier to understand and use.
There is two way to use modules
- We can define our most used functions in a module and import them, instead of copying their definitions into different programs.
- We can download the required package from the library and then import the functions, instead of writing complex functions
Learn more about Python modules, and use resources.
Approved by experts