def triangles():
c = [1]
while True:
print(c)
yield c
c = [x+c[i+1] for i,x in enumerate(c) if len(c)>i+1]
c.append(1)
c.insert(0,1)
Sign in to make a reply
惊蛰-清明
def triangles():
c = [1]
while True:
print(c)
yield c
c = [x+c[i+1] for i,x in enumerate(c) if len(c)>i+1]
c.append(1)
c.insert(0,1)