Advertisement
ranisalt

Euler 2 v2

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