Discuss / Python / 最笨的方法

最笨的方法

Topic source

超级lion

#1 Created at ... [Delete] [Delete and Lock User]

def triangles(): l=[1] yield l while True: ll=[]

    #遍历计算出L 加入到新的ll
    a=0
    b=0
    for temp in l:
        b=temp
        ll.append(a+b)
        a=b
    ll.append(1)
    l=ll
    yield l

  • 1

Reply