Skip to content

Instantly share code, notes, and snippets.

@sizumita
Created January 22, 2017 08:37
Show Gist options
  • Save sizumita/352d6da6677866fda35ef2649baa5c24 to your computer and use it in GitHub Desktop.
Save sizumita/352d6da6677866fda35ef2649baa5c24 to your computer and use it in GitHub Desktop.
y = 0
def fibonacci(n, a=1, b=0):
return b if n < 1 else fibonacci(n - 1, a + b, a)
for x in xrange(1,35):
f = fibonacci(x, a=1, b=0)
if f % 2 == 0:
y = y + f
print y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment