Python/Project Euler/Problem 02/sol2.py
2018-01-21 03:34:09 -05:00

14 lines
231 B
Python

def fib(n):
ls = []
a,b = 0,1
n += 1
for i in range(n):
if (b % 2 == 0):
ls.append(b)
else:
pass
a,b = b, a+b
print (sum(ls))
return None
fib(10)