###Created: 2/10/16
"""
Problem 2
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

"""
###Last Edited by Ian Warn 2/10/16
x=1
y=2
current=2
new_current=0
fibonacci_total=0

while current<4000000:
     
     if current%2==0:
        fibonacci_total+=current
     
    
     current=x+y
     x=y
     y=current
    
    
print(fibonacci_total)
    
    
