En Mon, 26 Feb 2007 11:26:43 -0300, <[EMAIL PROTECTED]> escribió:
> It works great now. Thank you for all of your incredibly quick
> replies.
Now that you have solved your immediate problem, you could read:
http://effbot.org/zone/python-objects.htm
--
Gabriel Genellina
--
http://mail.python.
[EMAIL PROTECTED] wrote:
> All,
> It works great now. Thank you for all of your incredibly quick
> replies.
> Rob
You should have a read of these:
http://wiki.python.org/moin/BeginnersGuide
http://effbot.org/zone/python-objects.htm
Cheers,
Tim Delaney
--
http://mail.python.org/mailman/listin
All,
It works great now. Thank you for all of your incredibly quick
replies.
Rob
--
http://mail.python.org/mailman/listinfo/python-list
If you want to copy lists, you do it by using the [:] operator. e.g.:
>>> a = [1,2]
>>> b = a[:]
>>> a
[1, 2]
>>> b
[1, 2]
>>> b[0] = 2
>>> a
[1, 2]
>>> b
[2, 2]
If you want to copy a list of lists, you can use a list comprehension
if you do not want to use the copy module:
>>> a = [[1,2],[3,4]]
[EMAIL PROTECTED] wrote:
> I do not have a clue what is happening in the code below.
> >>> a=[[2,4],[9,3]]
> >>> b=a
> >>> [map(list.sort,b)]
> [[None, None]]
> >>> b
> [[2, 4], [3, 9]]
> >>> a
> [[2, 4], [3, 9]]
> I want to make a copy of matrix a and then make changes to the
> matrices separate
On 26 Feb 2007 05:50:24 -0800, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> I do not have a clue what is happening in the code below.
>
> >>> a=[[2,4],[9,3]]
> >>> b=a
> >>> [map(list.sort,b)]
> [[None, None]]
> >>> b
> [[2, 4], [3, 9]]
> >>> a
> [[2, 4], [3, 9]]
>
> I want to make a copy of matr
[EMAIL PROTECTED] wrote:
> I do not have a clue what is happening in the code below.
>
a=[[2,4],[9,3]]
b=a
[map(list.sort,b)]
> [[None, None]]
b
> [[2, 4], [3, 9]]
a
> [[2, 4], [3, 9]]
>
> I want to make a copy of matrix a and then make changes to the
> matrices separate
I do not have a clue what is happening in the code below.
>>> a=[[2,4],[9,3]]
>>> b=a
>>> [map(list.sort,b)]
[[None, None]]
>>> b
[[2, 4], [3, 9]]
>>> a
[[2, 4], [3, 9]]
I want to make a copy of matrix a and then make changes to the
matrices separately. I assume that I am missing a fundamental
c