Skip to content

Instantly share code, notes, and snippets.

Created October 4, 2020 19:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save phabee/b4b0c0c1a47855c04802c381026bae9c to your computer and use it in GitHub Desktop.
def fibonacci(n):
if n >= 2:
return fibonacci(n - 2) + fibonacci(n - 1)
elif n == 2:
return 1
elif n == 1:
return 1
return 0
from pytictoc import TicToc
t = TicToc()
a = fibonacci(30)
Copy link

phabee commented Oct 4, 2020

Simple fibonacci experiment with python to calculate n-th fibonacci number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment