def triangles(): b = [1] while True: yield b b.insert(0, 0) for x in range(len(b[:-1])): b[x] += b[x + 1]
g = triangles() for n in range(3): print(next(g))
Sign in to make a reply
jimmy在上海