Discuss / Python / 写的有点多

写的有点多

Topic source

    yield [1]

    l = [1,1]

    yield l

    n=1

    while True:

        l_res =[]

        l_res.append(l[0])

        for x in range(n):

            l_res.append(l[x]+l[x+1])

        l_res.append(l[-1])

        yield l_res

        l = l_res

        n = n + 1


  • 1

Reply