- 怎么样新建一个二维矩阵
Matrix = [][]
或者Matrix = [5][5]
都是不行的
#Creates a list containing 5 lists, each of 8 items, all set to 0
w, h = 8, 5;
Matrix = [[0 for x in range(w)] for y in range(h)]
Matrix = [][]
或者Matrix = [5][5]
都是不行的#Creates a list containing 5 lists, each of 8 items, all set to 0
w, h = 8, 5;
Matrix = [[0 for x in range(w)] for y in range(h)]
本文标题:python 中新建一个二维矩阵的方法
本文链接:https://www.haomeiwen.com/subject/jahrpftx.html
网友评论