Discuss / Python / 好像比较复杂

好像比较复杂

Topic source

老施基

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

    L = [1]

    yield L

    L = [1,1]

    yield L

    n = 1

    while 1:

        n = n+1

        i = 1

        L1 = [1,]

        while i < n:

            L1.append(L[i-1]+L[i])

            i = i+1

        L1.append(1)

        L = []

        for k in L1:

            L.append(k)

        yield L


  • 1

Reply