Discuss / Python / 简化

简化

Topic source

def triangles(): l = [] # 第一行 while True: l = [1] + [l[x - 1] + l[x] for x in range(1, len(l))] + [0] yield l[:-1]


  • 1

Reply