Azad Rasul




9- Modules in Python

Azad Rasul's photo
Azad Rasul
·Jun 27, 2021·

1 min read

Play this article

In the modules, we can use a set of functions without being required to redefine them. Then, from a group of related modules, we can create a package. Create a simple module:

def hi(name):
    print("Hello, " + name)

Save it as "module1" in your directory.

Use the module:

import module1
# Hello, Ali

Built-in module

We can import various built-in modules in Python.

import platform
# Windows

Import module from a package:

import matplotlib.pyplot as plt

If you like the content, please SUBSCRIBE to my channel for future content.

To get full video tutorial and certificate, please, enroll in the course through this link:

Share this