def fibo(max): a, b = 1, 2 while a < max: yield a a, b = b, a + b print(sum(list(filter(lambda n: n % 2 == 0, list(fibo(4000000))))))