- 怎么样新建一个二维矩阵
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)]