Skip to content

Instantly share code, notes, and snippets.

@larrycai
Created October 13, 2011 01:02
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 larrycai/1283081 to your computer and use it in GitHub Desktop.
Save larrycai/1283081 to your computer and use it in GitHub Desktop.
solution for problem 2
# http://projecteuler.net/problem=2
total = 0;
a,b = 0,1
while a<4000000:
a,b = b,a+b
if a %2 == 0:
print a;
total += a;
print total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment