Skip to content

Instantly share code, notes, and snippets.

@yasuharu519
Created July 24, 2012 00:51
Show Gist options
  • Save yasuharu519/3167236 to your computer and use it in GitHub Desktop.
Save yasuharu519/3167236 to your computer and use it in GitHub Desktop.
Project Euler No.2
def generateFib():
a = 1
b = 2
while a < 4000000:
a, b = b, a + b
if a % 2 == 0:
yield a
else:
continue
print sum([x for x in generateFib()])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment