with the outside world are the tools it usesand the tools it defines maximize module cohesionunified purpose you can minimize module' couplings by maximizing its cohesionif all the components of module share general purposeyou're less likely to depend on external names modules should rarely change other modulesvariables we illustrated this with code in but it' worth repeating hereit' perfectly ok to use globals defined in another module (that' how clients import servicesafter all)but changing globals in another module is often symptom of design problem there are exceptionsof coursebut you should try to communicate results through devices such as function arguments and return valuesnot cross-module changes otherwiseyour globalsvalues become dependent on the order of arbitrarily remote assignments in other filesand your modules become harder to understand and reuse as summaryfigure - sketches the environment in which modules operate modules contain variablesfunctionsclassesand other modules (if importedfunctions have local variables of their ownas do classes--objects that live within modules and which we'll begin studying in the next as we saw in part ivfunctions can nesttoobut all are ultimately contained by modules at the top figure - module execution environment modules are importedbut modules also import and use other moduleswhich may be coded in python or another language such as modules in turn contain variablesfunctionsand classes to do their workand their functions and classes may contain variables and other items of their own at the topthoughprograms are just sets of modules advanced module topics