Discuss / Python / 交作业

交作业

Topic source

FengBNU

#1 Created at ... [Delete] [Delete and Lock User]
yield [1]
L1=[1]
while True:
    L2=[x for x in L1]
    L2.append(0)
    for i in range(len(L2)):
        if i==0 or i==len(L2)-1:
            L2[i]=1
        else:
            L2[i]=L1[i-1]+L1[i]
    L1=L2        
    yield L2

  • 1

Reply