Skip to content

Instantly share code, notes, and snippets.

@ggodreau
Created March 9, 2020 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggodreau/bdb294177d14bfeaeaac237e64ee0d67 to your computer and use it in GitHub Desktop.
Save ggodreau/bdb294177d14bfeaeaac237e64ee0d67 to your computer and use it in GitHub Desktop.
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