Importing Modules in Python with Examples

Importing Modules in Python with Examples

A module is simply a block of code saved as a python file recognized with the .py extension. The codes, in the python file, which could be in functions, classes, or variables can be reused in a different python file. When you want to reuse the code in a python file in another code, you need to import the file as a module. The filename generally becomes the name of the module. 

To view or add a comment, sign in

More articles by Rose Britney

Insights from the community

Others also viewed

Explore topics