def triangles(): n=[1] while True: yield n n=[1]+[n[i]+n[i+1] for i in range(len(n)-1)]+[1]
Sign in to make a reply
Zlstg