方法1 直接定义
matrix = [ [0, 0, 0], [0, 0, 0], [0, 0, 0] ]
方法2 间接定义
matrix = [ [ 0 for i in range(3) ] for i in range(3) ]
方法1 直接定义
matrix = [ [0, 0, 0], [0, 0, 0], [0, 0, 0] ]
方法2 间接定义
matrix = [ [ 0 for i in range(3) ] for i in range(3) ]
转载于:https://www.cnblogs.com/LLgloria/p/9944501.html