challenges/e2/e2.py

12 lines
166 B
Python
Raw Permalink Normal View History

2011-04-03 08:53:00 +02: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