I have this matrix:
mat = [[ 0 for x in range(row)] for y in range(column)]
I tried to add elements to the matrix:
for x in range(row): # row is 2
for y in range(column): # column is 3
mat[x][y] = int(input("number: "))
but the shell returns this error:
Traceback (most recent call last):
File "C:\Users\Fr\Desktop\pr.py", line 13, in <module>
mat[x][y] = 12
IndexError: list assignment index out of range
how do I add elements to a matrix?