def triangles():
n = [1]
while True:
yield n
n = [x+y for x,y in zip([0] + n,n+[0])]
j = 0
for t in triangles():
print(t)
j = j + 1
if j == 10:
break
Sign in to make a reply
Z小龙zxl
def triangles():
n = [1]
while True:
yield n
n = [x+y for x,y in zip([0] + n,n+[0])]
j = 0
for t in triangles():
print(t)
j = j + 1
if j == 10:
break