I am trying to append
to a multi-dimensional array.
This is what I have done so far:
arr=[[]]
for i in range(10):
for j in range(5):
arr[i].append(i*j)
print i,i*j
print arr
This is my expected output:
[[0,0,0,0,0],[0,1,2,3,4],[0,2,4,6,8],[0,3,6,9,12],[0,4,8,12,16],[0,5,10,15,20],[0,6,12,18,24],[0,7,14,21,28],[0,8,16,24,32],[0,9,18,27,36]]
However, I am getting this error:
IndexError
: list index out of range