0
How to read matrix input into a 2-D list in python 3?
I am trying to input a 3X3 matrix in 2D list input format is 1 2 3 4 5 6 7 8 9
1 Odpowiedź
+ 2
If you're reading from a file:
arraylist = []
for line in file:
innerlist = []
for number in line.split():
innerlist.append(int(number))
arraylist.append(innerlist)