Transcript
the following content is provided under a Creative Commons license your support will help MIT open courseware continue to offer highquality educational resources for free to make a donation or view additional materials from hundreds of MIT courses visit MIT opencourseware at ocw.mit.edu all right so let's see so first we have L1 is equal to bacon eggs I'm going to short for Shand this L2 is equal to toast and jam brunch I should actually make these arrows brunch is equal to L1 so this is just aliasing which means brunch is going to point to whatever L1 object points to and if I do L1 do aen juice L1 is now going to be bacon eggs and juice okay this L1 has been mutated to be that and since brunch still points to the same object that L1 points to brunch is now going to point to there okay so when I do brunch.
extend L2 I'm going to take whatever brunch is which is this part here and I'm going to extend it by L2 which is toast and Jam okay so it's just going to contain a large list of those five elements because because of this side effect issue where brunch was was this pointing to the same thing that L1 was pointing it to okay so it's close but I think perfect yes that's that's the right answer