hi,
i've created a 2D list(ie: A=[]). i choose some of element from the list(ie: A[0][0],A[1][1],A[2][2]) and do simple add operations.
Then i created another empty 2D list to store the result. but i wanted the result to be stored at a specific index (ie: at B=[0][0],B[1][1],B[2][2]).
but i get an error."Error - list index out of range "
here is my code...can anyone spot my mistake...
i've created a 2D list(ie: A=[]). i choose some of element from the list(ie: A[0][0],A[1][1],A[2][2]) and do simple add operations.
Then i created another empty 2D list to store the result. but i wanted the result to be stored at a specific index (ie: at B=[0][0],B[1][1],B[2][2]).
but i get an error."Error - list index out of range "
here is my code...can anyone spot my mistake...
Code:
A=[]
for i in range(3):
A.append([])
A[0]=(1,3,4,5)
A[1]=(2,4,6,5)
A[2]=(3,6,7,4)
B=[]
for j in range(3):
B.append([])
for i in range(3):
B[i][i]=2+A[i][i]
Comment