Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yuvipanda
Created December 4, 2009 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuvipanda/249207 to your computer and use it in GitHub Desktop.
Save yuvipanda/249207 to your computer and use it in GitHub Desktop.
past = 0
cur = 1
next = 1
sum = 0
while next < 4000000:
next = cur + past
past = cur
cur = next
if cur % 2 == 0:
sum += cur
print sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment