130925 references values and modifying lists question

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: [email protected] and answer reference the same list –  This is true for all kinds of objects, not just lists References, values, and modifying lists answer answer[0] = answer[3] 0x268 question 0x268 orphan 0x26c are awake 0x28a 0x2ac this 0x2fd 0x2eb you for •  The assignment operator does not make a copy of individual elements in the list either –  Now, both answer[0] and answer[3] reference the same element •  An object that is not referenced anywhere is an orphan 3 13 ­09 ­25 References, values, and modifying lists question 0x268 0x26c answer = [email protected] answer[0] = answer[3] answer[1] = answer[4] answer[4] = answer[2] answer[2] = 'I' answer [3] = 'am' are answer 0x268 0x2ac 0x28a awake 0x2fd 0x2fd this you 0x2be 0x2eb 0x2eb for 0x2db 0x2ac awake for this I am Garbage [email protected] answer 0x268 0x2fd 0x2be 0x2eb 0x2db 0x2ac awake are you for this I am •  The obj...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online