#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.

fibo = []
fibo.append(1)
fibo.append(2)


while fibo[len(fibo)-1]<4000000:
	last = len(fibo)-1
	last2 = len(fibo)-2
	new = fibo[last] + fibo[last2]
	print new
	fibo.append(new)

print sum(fibo)
print len(fibo)

fibo2 = []
for i in fibo:
	if i%2==0:
		fibo2.append(i)

print fibo2
print sum(fibo2)