Last active
September 11, 2020 21:14
-
-
Save betaprojects/80b8b7653bca9705931e3ebb8e5d57a9 to your computer and use it in GitHub Desktop.
Project Euler & HackerRank problem 2 solution: Even Fibonacci numbers - solved using Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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