Discuss / Python / 为什么第二行不会是[1,1,1] 啊

为什么第二行不会是[1,1,1] 啊

Topic source

蘭__吾凡

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

def triangles():

    g = [1]

    while True:

        yield g

        g = [1] + [g[x - 1] + g[x] for x in range(1, len(g))] + [1]


  • 1

Reply