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