Discuss / Python / 完整代码

完整代码

Topic source
在此插入代码

def triangles(): L = [1] while 1: yield L L = [1] + [L[x-1] + L[x] for x in range(1,len(L))] + [1] n = 0 for t in triangles(): print(t) n += 1 if n == 10: break


  • 1

Reply