[Tutor] Sequential assignment to list subscripts

John Abbe johnca@ourpla.net
Sun Nov 3 01:39:02 2002


Sequential assignment to integer variables works:

>>>  a, b=5, 6
>>>  a
5
>>>  b
6

Great. Can someone explain...

>>>  a=b=[0]
>>>  a
[0]
>>>  b
[0]
>>>  a[0], b[0] = 7, 8
>>>  a
[8]
>>>  b
[8]

...why a[0] isn't equal to 7  ?!?

(and more to the point, what the proper syntax would be?)

Life,
John
-- 
  All you  /\/\ John Abbe             "If you don't like the news,
      need \  / CatHerder              go out and make some of your own."
      is... \/  http://www.ourpla.net/john/               --Wes Nisker