writers of functions and consumers of the other functions called inside their functions it is useful to keep those two roles separatethe user of an already written function needs to know the name of the function the order and meaning of parameters what is returned or produced by the function how this is accomplished is not relevant at this point for instanceyou use the work of the python development teamcalling functions that are built into the language you need know the three facts about the functions you call you do not need to know exactly how the function accomplishes its purpose on the other hand when you write function you need to figure out exactly how to accomplish your goalname relevant variablesand write your codewhich brings us to the next section local scope for the logic of writing functionsit is important that the writer of function knows the names of variables inside the function on the other handif you are only using functionmaybe written by someone unknown to youyou should not care what names are given to values used internally in the implementation of the function you are calling python enforces this idea with local scope rulesvariable names initialized and used inside one function are invisible to other functions such variables are called local variables for examplean elaboration of the earlier program return py might have its lastfirst function with its local variable separatorbut it might also have another function that defines separator variablemaybe with different value like '\nthey would not conflict they would be independent this avoids lots of errorsfor examplethe following code in the example program badscope py causes an execution error read it and run itand see'''program causing an error with an undefined variable''def main() (def ()print(xerrorf does not know about the defined in main main(we will fix this error below the execution error message mentions "global namenames defined outside any function definitionat the "top-levelof your program are called global they are special case they are discussed more in the next section if you do want local data from one function to go to anotherdefine the called function so it includes parametersread and compare and try the program goodscope py''' change to badscope py avoiding any error by passing parameter''def main() (xdef ( )print(xmain( defining functions of your own