Advertisement
ranisalt

Euler 2

Aug 18th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. def fib():
  2.     x, y = 1, 2
  3.     while x < 4000000:
  4.         yield not(x & 1) and x or 0
  5.         x, y = y, x + y
  6.    
  7. print sum([x for x in fib()])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement