📜  帕斯卡的三角形python代码示例

📅  最后修改于: 2022-03-11 14:45:55.240000             🧑  作者: Mango

代码示例3
def pascal_triangle(n):
       trow = [1]
       y = [0]
       for x in range(max(n,0)):
          print(trow)
          trow=[l+r for l,r in zip(trow+y, y+trow)]
       return n>=1
pascal_triangle(6)