functionsscopingand abstraction formal parameter and the local variable that are used in exist only within the scope of the definition of the assignment statement within the function body binds the local name to the object the assignments in have no effect at all on the bindings of the names and that exist outside the scope of here' one way to think about thisat top leveli the level of the shella symbol table keeps track of all names defined at that level and their current bindings when function is calleda new symbol table (sometimes called stack frameis created this table keeps track of all names defined within the function (including the formal parametersand their current bindings if function is called from within the function bodyyet another stack frame is created when the function completesits stack frame goes away in pythonone can always determine the scope of name by looking at the program text this is called static or lexical scoping figure contains slightly more elaborate example def ( )def () 'abcprint ' =' def () print ' =' print ' =' ( (print ' =' return (xprint ' =' print ' =' (figure nested scopes the history of the stack frames associated with the code in figure is depicted in figure