python keyboard input matrix

import numpy as np
m = int((input("请输入行数"))
res=[]
for i in range(m):
	ans=[int(j) for j in input('输入:').split()]
	res.append(ans)
print('输出:',res)

Reference: (3 messages) python gets data from the keyboard (integer, list, matrix)_La La La (●'◡'●)'s Blog-CSDN Blog_python gets the list from the keyboard

Guess you like

Origin blog.csdn.net/m0_60461719/article/details/127233759