more on slicing) [ [: [ [ [ make copy of (or list( )copy copy( )etc is not changed herethe change made through is not reflected in because references copy of the object referencesnot the originalthat isthe two variables point to different pieces of memory note that this slicing technique won' work on the other major mutable core typesdictionaries and setsbecause they are not sequences--to copy dictionary or setinstead use their copy(method call (lists have one as of python as well)or pass the original object to their type namesdict and set alsonote that the standard library copy module has call for copying any object type genericallyas well as call for copying nested object structures-- dictionary with nested listsfor exampleimport copy copy copy(yx copy deepcopy(ymake top-level "shallowcopy of any object make deep copy of any object ycopy all nested parts we'll explore lists and dictionaries in more depthand revisit the concept of shared references and copiesin and for nowkeep in mind that objects that can be changed in place (that ismutable objectsare always open to these kinds of effects in any code they pass through in pythonthis includes listsdictionariessetsand some objects defined with class statements if this is not the desired behavioryou can simply copy your objects as needed shared references and equality in the interest of full disclosurei should point out that the garbage-collection behavior described earlier in this may be more conceptual than literal for certain types consider these statementsx 'shrubberyreclaim nowbecause python caches and reuses small integers and small stringsas mentioned earlierthe object here is probably not literally reclaimedinsteadit will likely remain in system table to be reused the next time you generate in your code most kinds of objectsthoughare reclaimed immediately when they are no longer referencedfor those that are notthe caching mechanism is irrelevant to your code for instancebecause of python' reference modelthere are two different ways to check for equality in python program let' create shared reference to demonstrateshared references