New to python and I keep getting this error when I try running my code. This is the code I'm trying to run
table=[0]*3
column=0
n=0
with open('matrix.txt','r') as f:
numbers=f.read()
numbers=[int(x) for x in numbers.split()]
for i in range(3):
table[column]=[0]*3
for j in range(3):
table[i][j]=numbers[n]
n+=1
column+=1
print(table)
I want to make a 3x3 table of the contents in my file. the file contents are;
2 3 4 1 2 6 9 8 9
I keep getting the error message when I run it. Any ideas on how to fix it?
columnand notcollumnline before the last one