Discuss / Python / 好像我写的这个好丑啊,不过能用

好像我写的这个好丑啊,不过能用

Topic source

taogebuaa

#1 Created at ... [Delete] [Delete and Lock User]
def triangles():
    L2=[1]
    empty=[1]
    while True:
        i=0
        while i+1<len(L2):
            temp=L2[i]+L2[i+1]
            empty.append(temp)
            i=i+1
        empty.append(1)
        L2=empty
        empty=[1]
        yield L2

  • 1

Reply