Created
August 17, 2012 20:53
-
-
Save captainsafia/3382545 to your computer and use it in GitHub Desktop.
Solution to Project Euler Problem 2 in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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