python 二维数组读入

 

study from : https://www.cnblogs.com/reaptomorrow-flydream/p/9613847.html


python 二维数组键盘输入

1 m = int(input())
2 grid = [[] for i in range(m)]
3 for i in range(m):
4     line = input().split(' ')
5     for j in range(len(line)):
6         grid[i].append(int(line[j]))

posted @ 2018-11-09 11:05  congmingyige  阅读(2606)  评论(0编辑  收藏  举报