title: Finding the sum of even valued terms in Fibonacci sequence
body: <pre><code>#!/usr/bin/python2
  
  """
  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.
  """
  
  odd, even = 0,1
  total = 0
  while True:
      odd = odd + even  #Odd
      even = odd + even     #Even
      if even &lt; 4000000:
          total += even
      else:
          break
  print total
  </code></pre>
  
  <p><strong>My algo:</strong></p>
  
  <ol>
  <li>If I take first 2 numbers as 0, 1; the number that I find first in while loop will be an odd number and first of Fibonacci series.</li>
  <li>This way I calculate the even number and each time add the value of even to total.</li>
  <li>If value of <code>even</code> is greater than 4e6, I break from the infinite loop.</li>
  </ol>
  
  <p>I have tried so much but my answer is always wrong. Googling says the answer should be <code>4613732</code> but I always seem to get <code>5702886</code></p>