Skip to content

Instantly share code, notes, and snippets.

@betaprojects
Last active September 11, 2020 21:14
Show Gist options
  • Save betaprojects/80b8b7653bca9705931e3ebb8e5d57a9 to your computer and use it in GitHub Desktop.
Save betaprojects/80b8b7653bca9705931e3ebb8e5d57a9 to your computer and use it in GitHub Desktop.
Project Euler & HackerRank problem 2 solution: Even Fibonacci numbers - solved using Python
s, x, y = 0, 0, 2
L = int(input('Sum of even Fibonacci numbers <'))
while y < L:
s, x, y = s+y, y, 4*y+x
print ("is", s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment