<jupyter_start><jupyter_text>**Problem 2 - Even Fibonacci numbers**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, \dots$$By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.<jupyter_code>N = 4000000
F[1] = 1
F[2] = 2

sum = F[2] # sum the even-valued
k = 2
while F[k] <= N:
  k+=1
  F[k] = F[k-1] + F[k-2] # calculate the k-th Fibonacci number
  if F[k]%2==0:
    sum += F[k]
print(sum)<jupyter_output>4613732