record onto the run-time stack when function is called when function returns the python interpreter pops the corresponding activation record off the run-time stack python stores the identifiers defined in the local scope in an activation record when function is calleda new scope becomes the local scope at the same time new activation record is pushed onto the run-time stack this new activation record holds all the variables that are defined within the new local scope when function returns its corresponding activation record is popped from the run-time stack the heap is the area of ram where all objects are stored when an object is created it resides in the heap the run-time stack never contains objects references to objects are stored within the run-time stack and those references point to objects in the heap consider the program in fig when the python interpreter is executing lines and of the programthe run-time stack looks as it does in fig there are three activation records on the run-time stack the first activation record pushed onto the run-time stack was for the module when the module first began executingthe python interpreter went through the module from top to bottom and put any variable definitions in the module scope into the activation record for the module in this program that consisted of the reference pi to the value thenat the end of the module the if statement called the main function this caused the python interpreter to push the activation record for the main function the variables defined within the main function include historyofpromptshistoryofoutputrstringrand val each of these appear within the activation record for the main function as the main function began executing it called the getinput function when that call occurred there was an activation record pushed for the function call that activation record contained the prompt and variables this activation record does not appear in the figure because by the time we execute line and of the program the python interpreter has already returned from the getinput function when the interpreter returned from the function call the corresponding activation record was popped from the run-time stack finallythe program calls the showoutput function on line and execution of the function begins an activation record for the showoutpout function call was pushed onto the run-time stack when showoutput was called the references local to that scopewhich includes just the val variablewere stored the activation record for this function call you can run this example program using wing or some other ide the code for it appears in sect when you use the wing ide to run this program you can stop the program at any point and examine the run-time stack for instancefig shows wing in the midst of running this program breakpoint has been set on line to stop the program the tab at the bottom of the wing ide window shows the stack data this is the run-time stack right below the stack data tab there is combination box that currently displays showoutput()scope pyline this combo box lets you pick from the activation record that is currently being displayed if you pick different activation recordits contents will be displayed directly below it in the wing ide this copy belongs to 'acha