def triangles(max):
L = [1]
n = 1
while n <= max:
yield L
L = [1] + [L[i] + L[i-1] for i in range(1,len(L))] + [1]
n = n + 1
for i in triangles(10):
print(i)
def triangles(max):
L = [1]
n = 1
while n <= max:
yield L
L = [1] + [L[i] + L[i-1] for i in range(1,len(L))] + [1]
n = n + 1
for i in triangles(10):
print(i)