def triangles():
N = [1]
while True:
yield N
N.append(0)
N = [N[i-1] + N[i] for i in range(len(N))]
n = 0
for t in triangles():
print(t)
n = n + 1
if n == 10:
break
廖雪峰老师出的题
原文地址:https://www.cnblogs.com/xiangpiaopiao2011/p/9300792.html
时间: 2024-10-04 03:17:01