Discuss / Python / 作业

作业

Topic source

Mario7788

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

    L = [1]

    while True:

        yield L

        L = [L[x]+L[x+1] for x in range(len(L)-1)]

        L.insert(0,1)

        L.append(1)

#借鉴了其他教程,自己啥时才写得出来。。。

smallcai1983

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

先用复杂的方法实现,然后再慢慢考虑精简代码,可能是比较好的方式

Mario7788

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

谢谢🙏


  • 1

Reply