modules is that programs are designed to be runwhereas modules are designed to be imported and used by programs not all modules have associated py files--for examplethe sys module is built into pythonand some modules are written in other languages (most commonlychowevermuch of python' library is written in pythonsofor exampleif we write import collections we can create named tuples by calling collections namedtuple()and the functionality we are accessing is in the collections py module file it makes no difference to our programs what language module is written insince all modules are imported and used in the same way several syntaxes can be used when importing for exampleimport importable import importable importable importablen import importable as preferred_name here importable is usually module such as collectionsbut could be package or module in packagein which case each part is separated with dot )for exampleos path the first two syntaxes are the ones we use throughout this book they are the simplest and also the safest because they avoid the possibility of having name conflictssince they force us to always use fully qualified names the third syntax allows us to give name of our choice to the package or module we are importing--theoretically this could lead to name clashesbut in practice the as syntax is used to avoid them renaming is particularly useful when experimenting with different implementations of module for exampleif we had two modules mymodulea and mymoduleb that had the same api (application programming interface)we could write import mymodulea as mymodule in programand later on seamlessly switch to using import mymoduleb as mymodule where should import statements goit is common practice to put all the import statements at the beginning of py filesafter the shebang lineand after the module' documentation and as we said back in we recommend importing standard library modules firstthen third-party library modulesand finally our own modules here are some other import syntaxesfrom importable import object as preferred_name from importable import object object objectn from importable import (object object object object object object objectnfrom importable import packages