def triangles(): T = [] n = 0 while True: L = [] for i in range(0,n+1): if i==0 or i==n : L.append(1) else: L.append(T[n-1][i-1]+T[n-1][i]) T.append(L) n = n+1 yield L
Sign in to make a reply
XNOKIA