Discuss / Python / 每天进步一点点

每天进步一点点

Topic source

you_you_k

#1 Created at ... [Delete] [Delete and Lock User]
def func(max):
    L = [1]
    while len(L)<=max:
        yield L
        L = [1]+[L[x] + L[x+1] for x in range(0,len(L)-1)]+[1]
for x in func(3):
    print(x)

  • 1

Reply