challenges/e2/e2.py

12 lines
166 B
Python
Raw Normal View History

2011-04-03 06:53:00 +00:00
#!/usr/bin/python
last = sum = 0
current = 1
while (current < 4000000):
if current % 2 == 0:
sum += current
tmp = current
current += last
last = tmp
print sum