Discuss / Python / 0430

Gday小海狮

#1 Created at ... [Delete] [Delete and Lock User]
ls = [1]
while True:
    yield ls
    ls = [1] + [ls[i] + ls[i+1] for i in range(len(ls)-1) ] + [1] 

fb反驳

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

这才是python的正确打开方式,保存上一次的数组再求和,使用append(),添加到数组后边的一定是从C过来的。


  • 1

Reply