>>> l = []
>>> for i in range(2):
for j in range(2):
l[i][j] = 'x'



Traceback (most recent call last):
File "<pyshell#7>", line 3, in -toplevel-
l[i][j] = 'x'
IndexError: list index out of range

So you still have to dimension the list before you can use it , eg like
>l = []
>for i in range(2):
>    l.append([])
>    for j in range(2):
>        l[i].append(j)

then you do not get the indexerror, but I feel a class is what you need
here to make life easier and the program more readable

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to