n1, n2 = 0, 1 total = 0 while n2 < 4000000: print(n2) n1, n2 = n2, n1 + n2 if n2 % 2 == 0: total += n2 print('Sum: ', total)