E their values instead they keep references to the

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: followed by hex digits (the numbers 0 ­9, plus the leSers a ­f) •  A Python list actually consists of a bunch of these references 2 13 ­09 ­25 References, values, and modifying lists ques@on = ['are', 'you', 'awake', 'for', 'this'] question 0x268 0x26c are 0x2ac 0x28a awake this 0x2fd 0x2eb you for •  Lists in Python do not store the actual elements (i.e., their values). Instead, they keep references to the elements –  References are the addresses in memory where the elements (i.e., their actual values) are •  Keeping references simplifies the interpreter, but makes the mental model of program somewhat more complex References, values, and modifying lists answer 0x268 question 0x268 0x26c 0x2ac 0x28a 0x2fd 0x2eb answer = ques@on are awake this you for •  The assignment operator does not make a copy of the original list –  In the end, both q...
View Full Document

This document was uploaded on 03/02/2014.

Ask a homework question - tutors are online