()
| 1 | def compute(): |
| 2 | ans = 0 |
| 3 | x = 1 # Represents the current Fibonacci number being processed |
| 4 | y = 2 # Represents the next Fibonacci number in the sequence |
| 5 | while x <= 4000000: |
| 6 | if x % 2 == 0: |
| 7 | ans += x |
| 8 | x, y = y, x + y |
| 9 | return str(ans) |
| 10 | |
| 11 | |
| 12 | if __name__ == "__main__": |