What is a module in Python?

Experience Level: Junior
Tags: Python

Answer

A module in Python is a .py file that contains definitions and statements. It can define functions, classes and variables. 

It helps for the code to be logically organized and helps to improve maintainability, reusability, allows for simplicity and scoping to avoid collisions between identifiers in different parts of your application.

Related Python job interview questions
Python for beginners
Python for beginners

Are you learning Python ? Try our test we designed to help you progress faster.

Test yourself