Discuss / Python / 交作业

交作业

Topic source
    L = [1]
    while True:
        yield(L)
        L2 = L.copy()
        for i in range(1,len(L)):
            L[i] = L2[i-1]+L2[i]
        L.append(1)

xjt_matlab

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

L2=L.copy()是不是没有这个函数啊? 改成L2=L[:]进行L的复制


  • 1

Reply