n行杨辉三角 Python
从键盘输入n,然后输出n行的杨辉三角形。(n的大小不限制,可用列表推导式创建二维数组)11 11 2 11 3 3 11 4 6 4 1…用列表推导式创建二维数组.matrix = [[0 for i in range(3)] for i in range(3)]matrix = [[1,2,3] for i in range(3)]注意下面两段语句的结果:matrix1 = [1,2,3]matrix = [ matrix1 for i in range(3)]matrix