<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-family: 'times new roman'; font-size: 16px; ">So the problem is that when I change bb, aa also changes even</span><div><span class="Apple-style-span" style="font-family: 'times new roman'; font-size: 16px; ">though I don't want it to.&nbsp; Is this supposed to happen?</span></div><div><font class="Apple-style-span" face="'times new roman'" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br class="webkit-block-placeholder"></span></font></div><div><span class="Apple-style-span" style="font-family: 'times new roman'; font-size: 16px; ">&nbsp;&nbsp;Yes&nbsp;</span></div><div><font class="Apple-style-span" face="'times new roman'" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br class="webkit-block-placeholder"></span></font></div><div>Names are handles for objects. &nbsp;Assignment binds</div><div><div><div>a name to an object. &nbsp; The same object can be</div><div>bound simultaneously to many names.</div><div><br class="webkit-block-placeholder"></div><div>Python distinguishes between equality and identity, so</div><div>there are two comparison operators: &nbsp;'==' and 'is'. &nbsp; &nbsp;Objects</div><div>are equal if they have the same value (==) but they are</div><div>identical only if they refer to the same object (is).</div><div><br class="webkit-block-placeholder"></div><div><div>The constructor expressions [], {}, and () produce</div><div>new objects.</div><div><br></div></div><div><div>&gt;&gt;&gt; [1, 2] == [1, 2] # same value</div><div>True</div><div>&gt;&gt;&gt; [1, 2] is [1, 2] # but different&nbsp;lists</div><div>False</div><div><br class="webkit-block-placeholder"></div><div><div>&gt;&gt;&gt; a = [1, 2] # this is assigned to a new&nbsp;list</div><div>&gt;&gt;&gt; b = [1, 2] # this is also assigned to a new&nbsp;list</div><div>&gt;&gt;&gt; a == b # the&nbsp;lists&nbsp;have the same value</div><div>True</div><div>&gt;&gt;&gt; a is b # but they are not the same&nbsp;list</div><div>False</div><div><br class="webkit-block-placeholder"></div><div><div>&gt;&gt;&gt; a = [1, 2] # assign to a new&nbsp;list</div><div>&gt;&gt;&gt; b = a # attach the&nbsp;list&nbsp;in a to a new name</div><div>&gt;&gt;&gt; a == b # they have the same value</div><div>True</div><div><div>&gt;&gt;&gt; a is b # because they are the same&nbsp;list</div><div>True</div><div><br class="webkit-block-placeholder"></div><div>The list(FOO) function copies an&nbsp;list.</div><div><br class="webkit-block-placeholder"></div><div><div>&gt;&gt;&gt; a = [1, 2] # new&nbsp;list</div><div>&gt;&gt;&gt; b = list(a) # make a copy of the&nbsp;list&nbsp;in b</div><div>&gt;&gt;&gt; a == b # the original and copy are equal</div><div>True</div><div>&gt;&gt;&gt; a is b # but they are not the same&nbsp;list</div><div>False</div></div></div></div></div></div><div><br class="webkit-block-placeholder"></div><div><br></div><div><div><div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>- Jeff Younker - <a href="mailto:jeff@drinktomi.com">jeff@drinktomi.com</a> -</div></div><br class="Apple-interchange-newline"></span></div></span><br class="Apple-interchange-newline"> </div><br></div></div></div></div></div></body></html>