>>> def triangles():
... L = [1]
... while True:
... yield L
... L = [1] + [L[n] + L[n+1] for n in range(len(L)-1)] + [1]
...
Sign in to make a reply
Maplin (^ω^)
>>> def triangles():
... L = [1]
... while True:
... yield L
... L = [1] + [L[n] + L[n+1] for n in range(len(L)-1)] + [1]
...