also changedbecause both cheese and spam refer to the same list you can see this in figure - figure - cheese[ 'hello!modifies the list that both variables refer to although python variables technically contain references to valuespeople often casually say that the variable contains the value identity and the id(function you may be wondering why the weird behavior with mutable lists in the previous section doesn' happen with immutable values like integers or strings we can use python' id(function to understand this all values in python have unique identity that can be obtained with the id(function enter the following into the interactive shellid('howdy'the returned number will be different on your machine when python runs id('howdy')it creates the 'howdystring in the computer' memory the numeric memory address where the string is stored is returned by the id(function python picks this address based on which memory bytes happen to be free on your computer at the timeso it'll be different each time you run this code like all strings'howdyis immutable and cannot be changed if you "changethe string in variablea new string object is being made at different place in memoryand the variable refers to this new string for exampleenter the following into the interactive shell and see how the identity of the string referred to by bacon changesbacon 'helloid(bacon bacon +world! new string is made from 'helloand world!id(baconbacon now refers to completely different string lists