[Tutor] Problem with assigning list elements

Kent Johnson kent37 at tds.net
Fri Sep 14 20:14:28 CEST 2007


rgh2 at duke.edu 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-create-a-multidimensional-list.htm

Kent


More information about the Tutor mailing list