关于作者

Discuss / Python / 参考了前楼的代码,,

参考了前楼的代码,,

Topic source

吼kk

#1 Created at ...

def triangles(max): n = 1 L = [1] while n<=max: yield L L1 = [0] + L + [0] L = [L1[x]+L1[x+1] for x in range(len(L1)-1)] n = n+1 return 'done'

for c in triangles(100): print(c)


  • 1

Reply

WARNING: You are using an old browser that does not support HTML5. Please choose a modern browser (Chrome / Microsoft Edge / Firefox / Sarafi) to get a good experience.