fork download
  1. def euler2():
  2. f1, f2, s = 1, 2, 0
  3. while f2 < 4000000:
  4. s += 0 if f2 % 2 else f2
  5. f1, f2 = f2, f1 + f2
  6. return s
  7.  
  8. print(euler2())
Success #stdin #stdout 0.02s 9080KB
stdin
Standard input is empty
stdout
4613732