標準入力から読み込み、最初の行は行列の次元を指定するために、常に正方行列をしようとしているが、私のコードは、最初の行のみ
例入力
3
0 2 3
2 4 1
3 1 4
私のコード
を読み込み official documentationによるとdef read_matrix(formatted_string):
list_of_lists = [list(map(int, row.split())) for row in formatted_string.split('\n')]
return list_of_lists
x = input("enter the list of lists of numbers?")
print(read_matrix(x))