named example the function takes in two numbers and returns their sum importing moduleswe can import the definitions inside module to another module or the interactive interpreter in python we use the import keyword to do this to import our previously defined module examplewe type the following in the python prompt import example this does not import the names of the functions defined in example directly in the current symbol table it only imports the module name example there using the module name we can access the function using the dot operator for exampleexample add( , python has tons of standard modules you can check out the full list of python standard modules and their use cases these files are in the lib directory inside the location where you installed python standard modules can be imported the same way as we import our user-defined modules executing module as scriptany py file that contains module is essentially also python scriptand there isn' any reason it can' be executed like one here again is mod py as it was defined abovemod py "if comrade napoleon says itit must be right [ def foo(arg)print( 'arg {arg}'class foopass this can be run as scriptc:\users\john\documents>python mod py :\users\john\documentsthere are no errorsso it apparently worked grantedit' not very interesting as it is writtenit only defines objects it doesn' do anything with themand it doesn' generate any output