Skip to content

Instantly share code, notes, and snippets.

@serverhorror
Created April 3, 2014 17:00
Show Gist options
  • Select an option

  • Save serverhorror/9958460 to your computer and use it in GitHub Desktop.

Select an option

Save serverhorror/9958460 to your computer and use it in GitHub Desktop.
def fib(max):
a, b = 1, 2
while a<max:
yield a
a, b = b, a + b
def even(n):
if n%2==0: return True
return False
sum(filter(even, fib(4000000)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment