Discuss / Python / 再简练点

再简练点

Topic source

鱿鱼

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

def triangles():

    lines = [1]

    while True:

        yield lines

        newLine = [1,1]

        for i in range(1,len(lines)):

            newLine.insert(i,lines[i-1]+lines[i])

        lines=newLine


  • 1

Reply