Discuss / Python / Test

zlisd

#1 Created at ... [Delete] [Delete and Lock User]
def triangles():
    lst = [1]
    yield lst
    while True:
        for i in range(len(lst)-1, 0, -1):
            lst[i] = lst[i] + lst[i-1]
        lst.append(1)
        yield lst

以C语言节省空间的思维写的,不知道在python能不能达到效果


  • 1

Reply