append(method doesn' create new list objectit changes the existing list object we call this "modifying the object in-place eggs ['cat''dog'this creates new list id(eggs eggs append('moose'append(modifies the list "in placeid(eggseggs still refers to the same list as before eggs ['bat''rat''cow'this creates new listwhich has new identity id(eggseggs now refers to completely different list if two variables refer to the same list (like spam and cheese in the previous sectionand the list value itself changesboth variables are affected because they both refer to the same list the append()extend()remove()sort()reverse()and other list methods modify their lists in place python' automatic garbage collector deletes any values not being referred to by any variables to free up memory you don' need to worry about how the garbage collector workswhich is good thingmanual memory management in other programming languages is common source of bugs passing references references are particularly important for understanding how arguments get passed to functions when function is calledthe values of the arguments are copied to the parameter variables for lists (and dictionarieswhich 'll describe in the next this means copy of the reference is used for the parameter to see the consequences of thisopen new file editor windowenter the following codeand save it as passingreference pydef eggs(someparameter)someparameter append('hello'spam [ eggs(spamprint(spamnotice that when eggs(is calleda return value is not used to assign new value to spam insteadit modifies the list in placedirectly when runthis program produces the following output[ 'hello'even though spam and someparameter contain separate referencesthey both refer to the same list this is why the append('hello'method call inside the function affects the list even after the function call has returned