Python杨辉三角形

RT Show me the Code

def triangles():
b = [1]
while(True):
yield b
b = [1] + [b[i] + b[i+1] for i in range(len(b)-1)] + [1] n = 0
for idx in triangles():
print(idx)
n = n + 1
if n == 10:
break
上一篇:100个iOS开发/设计面试题汇总


下一篇:Shiro权限控制框架