2.7.1 Working with Modules in Python
Python Programming
A module in Python is just a file that contains Python code, such as functions, variables, and classes, which you can reuse in different parts of your program. Creating a module is easy. Just write your Python code in a file and save it with a .py extension. Here's how to create and use a module with the main, function:
Step 1: Create a module file named greetings .py.
# greetings.py
def say_As-Salaam-Alaikum () :
return "As - Salaam-Alaikum, everyone!"