def traingles(): L = [1] while True: yield L L = [L[i] + L[i + 1] for i in range(len(L) - 1)] L.insert(0, 1) L.append(1)
n = 0 for t in traingles(): print(t) n = n + 1 if n == 10: break
Sign in to make a reply
Pop_林肥強
def traingles(): L = [1] while True: yield L L = [L[i] + L[i + 1] for i in range(len(L) - 1)] L.insert(0, 1) L.append(1)
n = 0 for t in traingles(): print(t) n = n + 1 if n == 10: break