Skip to content

Instantly share code, notes, and snippets.

@soimort
Created March 5, 2012 00:52
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 soimort/1975701 to your computer and use it in GitHub Desktop.
Save soimort/1975701 to your computer and use it in GitHub Desktop.
Project Euler - Problem 2
a, b, i, sum = 1, 2, 2, 0
while b <= 4000000:
if b % 2 == 0:
sum += b
a, b, i = b, a + b, i + 1
print(sum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment