#!/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