11-10-2015, 09:31 PM
And I made the second one first try!
Code:
x = 1
y = 1
s = 0
while x + y < 4000000 and x + y * 2 < 4000000:
x += y
if x % 2 == 0:
s += x
y += x
if y % 2 == 0:
s += y
if x + y < 4000000:
x += y
if x % 2 == 0:
s += x
print(s)
else:
print(s)