# Author: James Tam # Version: March 6, 2010 # Learning concept: pass by reference (passing a reference to a # list and the address of the list is lost during the function # call). # In this case the local reference starts by refering to the list in the main # function. However the assignment statement now causes it to refer to another # list. The original list in the main function remains unchanged. def fun(list): list = [3,2,1] print(list) def main(): list = [1,2,3] print(list) fun(list) print(list) main()