Skip to content

Instantly share code, notes, and snippets.

@captainsafia
Created August 17, 2012 20:53
Show Gist options
  • Save captainsafia/3382545 to your computer and use it in GitHub Desktop.
Save captainsafia/3382545 to your computer and use it in GitHub Desktop.
Solution to Project Euler Problem 2 in Python
x,y,n,total=0,1,0,0
while n<=4000000:
n=x+y
x=y
y=n
if n%2==0:
total+=n
print total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment