"""
Even Fibonacci numbers: Project Euler Problem 2
Solution in Python
https://projecteuler.net/problem=2
Takes 0.4s on my computer
"""deffibonacci_sequence(n):numbers=[0,1]whilenumbers[-1]<n:numbers.append(numbers[-1]+numbers[-2])returnnumbersdefsum_even_fibonacci_numbers(n):# O(N) Complexitysequence=fibonacci_sequence(n)sequence=[nforninsequenceifn%2==0]returnsum(sequence)print(sum_even_fibonacci_numbers(4000000))

## re: Project Euler #2 - Even Fibonacci numbers VIEW POST

FULL DISCUSSIONOOhh Project Euler problems are my favorite!

I tried timing your algorithm, with couple other implementations I wrote. One was recursive, one was iterative. Check this out.

The output was interesting!