"""
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 hundered, find the sum of the even-valued terms.
"""
def Fibonacci(n):
	if n== 0:
		return 1
	elif n == 1:
		return 1
	else: return Fibonacci(n-2)+Fibonacci(n-1)


def sum_fibonacci(n):
	sum=0
	for i in range(0,n+1):
		if Fibonacci(i)%2 ==0:
			sum+=Fibonacci(i)
	return sum

print sum_fibonacci(10)