Re: [Tutor] Problem with assigning list elements

2007-09-14 Thread Eric Brunson
That is not the expected behavior and not the behavior I see: Python 2.5.1 (r251:54863, May 1 2007, 13:27:01) [C] on sunos5 >>> z = [[1,2],[3,4]] >>> z[0][0]=100 >>> print z [[100, 2], [3, 4]] [EMAIL PROTECTED] wrote: > I'm having a problem assigning numbers to a 2-D list. > > for the 2d li

Re: [Tutor] Problem with assigning list elements

2007-09-14 Thread bob gailer
[EMAIL PROTECTED] wrote: > I'm having a problem assigning numbers to a 2-D list. > > for the 2d list z for example, when I type in > > z[0][0]=67 > > every zeroth element of every sublist will be set to 67, instead of just > element > [0,0] being set to 67. > > If z = [[1,2],[3,4]] > > then z[0][0

Re: [Tutor] Problem with assigning list elements

2007-09-14 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > I'm having a problem assigning numbers to a 2-D list. > > for the 2d list z for example, when I type in > > z[0][0]=67 > > every zeroth element of every sublist will be set to 67, instead of just > element > [0,0] being set to 67. http://effbot.org/pyfaq/how-do-i-cre

[Tutor] Problem with assigning list elements

2007-09-14 Thread rgh2
I'm having a problem assigning numbers to a 2-D list. for the 2d list z for example, when I type in z[0][0]=67 every zeroth element of every sublist will be set to 67, instead of just element [0,0] being set to 67. If z = [[1,2],[3,4]] then z[0][0]=100 results in z= [[100,2],[100,4]] Is this