#mastery14 Creating and using a Python module

To create a python module you first have to create a new python program (in this case masteries.py) which contains functions (in this case hw() and gb())

Then, in order to use the module’s functions in another program you use import (name of the program)

After you have imported your module you can now use it’s functions by writing the name of the module (masteries) followed by a point and the name of the function inside that module (.hw() or .gb()) 

This will show the user:

Hello World (for hw())   and

Good bye (for gb()) (as shown in the picture above)

CC BY 4.0 #mastery14 Creating and using a Python module by Gilberto Rogel García is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.