a problem about "print"
levinie001 at gmail.com
Wed Jul 4 09:28:17 CEST 2012
Your method is cool.
But i doubt this, if bList and aList just are attached to the same List
when i write bList=aList,but why the output of the following two code are
i'm puzzled now.
2012/7/4 Harrison Morgan <harrison.morgan at gmail.com>
> On Wed, Jul 4, 2012 at 12:38 AM, levi nie <levinie001 at gmail.com> wrote:
>> that's good,thanks.
>> new problem.
>> when i write
>> del bList
>> bList and aList both change,how can i make aList not changed?
> Lists are mutable. That means that when you do bList = aList, you're just
> creating another reference to aList. They both point to the same list, just
> using different names. You should read up a bit on immutable vs. mutable
> objects. Here's something that I found that might explain it a bit better.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list