(continued from previous page[ fibo __name__ 'fiboif you intend to use function often you can assign it to local namefib fibo fib fib( more on modules module can contain executable statements as well as function definitions these statements are intended to initialize the module they are executed only the first time the module name is encountered in an import statement (they are also run if the file is executed as script each module has its own private symbol tablewhich is used as the global symbol table by all functions defined in the module thusthe author of module can use global variables in the module without worrying about accidental clashes with user' global variables on the other handif you know what you are doing you can touch module' global variables with the same notation used to refer to its functionsmodname itemname modules can import other modules it is customary but not required to place all import statements at the beginning of module (or scriptfor that matterthe imported module names are placed in the importing module' global symbol table there is variant of the import statement that imports names from module directly into the importing module' symbol table for examplefrom fibo import fibfib fib( this does not introduce the module name from which the imports are taken in the local symbol table (so in the examplefibo is not definedthere is even variant to import all names that module definesfrom fibo import fib( this imports all names except those beginning with an underscore (_in most cases python programmers do not use this facility since it introduces an unknown set of names into the interpreterpossibly hiding some things you have already defined note that in general the practice of importing from module or package is frowned uponsince it often causes poorly readable code howeverit is okay to use it to save typing in interactive sessions if the module name is followed by asthen the name following as is bound directly to the imported module import fibo as fib fib fib( in fact function definitions are also 'statementsthat are 'executed'the execution of module-level function definition enters the function name in the module' global symbol table modules