recursion built-in scope the final scope in python is the built-in scope if an identifier is not found within any of the nested scopes within module and it is not defined in the global scopethen python will examine the built-in identifiers to see if it is defined there for instanceconsider the identifier int if you were to write the followingx int(" "python would first look in the local scope to see if int were defined as function or variable within that local scope if int is not found within the local scopepython would look in all the enclosing scopes starting with the next inner-most local scope and working outwards from there if not found in any of the enclosing scopespython would then look in the global scope for the int identifier if not found therethen python would consult the built-in scopewhere it would find the int class or type with this explanationit should now be clear why you should not use identifiers that already exist in the built-in scope if you use int as an identifier you will not be able to use the int from the built-in scope because python will find int in local or enclosing scope first legb mark lutzin his book learning python [ ]described the rules of scope in python programs using the legb acronym this acronymstanding for localenclosingglobaland built-in can help you memorize the rules of scope in python the order of the letters in the acronym is important when the python interpreter encounters an identifier in programit searches the local scope firstfollowed by all the enclosing scopes from the inside outwardfollowed by the global scopeand finally the built-in scope the run-time stack and the heap as we learned in the last sectionthe parameters and body of each function define scope within python program the parameters and variables defined within the local scope of function must be stored someplace within the ram of computer python splits the ram up into two parts called the run-time stack and the heap the run-time stack is like stack of trays in cafeteria most cafeterias have device that holds these trays when the stack of trays gets short enough spring below the trays pops the trays up so they are at nice height as more trays are added to the stackthe spring in this device compresses and the stack pushes down stack in computer science is similar in many ways to this kind of device the run-time stack is stack of activation records the python interpreter pushes an activation this copy belongs to 'acha