Created
March 9, 2020 01:51
-
-
Save ggodreau/bdb294177d14bfeaeaac237e64ee0d67 to your computer and use it in GitHub Desktop.
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
def fib(n, f1, f2): | |
f3 = f1+f2 | |
print(n, f1,'+', f2, '=', f3) | |
if f3 < n: | |
n -= 1 | |
f3 = f2 + f1 | |
return fib(n, f2, f3) | |
else: | |
return f2 | |
if __name__ == '__main__': | |
print(fib(46368, 0, 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment