Created
January 4, 2020 22:06
-
-
Save nspool/0fb1870e69c518def068ce4940218c4d to your computer and use it in GitHub Desktop.
Euler 2
This file contains hidden or 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
s = 0 | |
def fib(x,y): | |
if y < 4000000: | |
if y % 2 == 0: | |
global s | |
s = s + y | |
v = fib(y, x + y) | |
return v | |
else: | |
return 0 | |
fib(1,2) | |
print(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment