from math import print(piprint(factorial( )output as said above import uses __import__(to search for the moduleand if not foundit would raise importerror exampleimport mathematics print(mathematics pioutputtraceback (most recent call last)file " :/users/gfg/tuples/xxx py"line in import mathematics importerrorno module named 'mathematics creating and exploring modules what are modules in pythonmodules refer to file containing python statements and definitions file containing python codefor exampleexample pyis called moduleand its module name would be example we use modules to break down large programs into small manageable and organized files furthermoremodules provide reusability of code we can define our most used functions in module and import itinstead of copying their definitions into different programs let us create module type the following and save it as example py python module example def add(ab)"""this program adds two numbers and return the result""result return result