def main(): s = 0 fibo = fibo_gen() while True: t = next(fibo) if t > 4000000: break if t % 2 == 0: s += t return s
def main(): for i, a in enumerate(fibo_gen()): if num_digits(a) == 1000: return i+1