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
[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
[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
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