RT Show me the Code
def triangles():
b = [1]
while(True):
yield b
b = [1] + [b[i] + b[i+1] for i in range(len(b)-1)] + [1]
n = 0
for idx in triangles():
print(idx)
n = n + 1
if n == 10:
break
RT Show me the Code
def triangles():
b = [1]
while(True):
yield b
b = [1] + [b[i] + b[i+1] for i in range(len(b)-1)] + [1]
n = 0
for idx in triangles():
print(idx)
n = n + 1
if n == 10:
break