Skip to content

Instantly share code, notes, and snippets.

@islandjoe
Created July 5, 2021 16:31
Show Gist options
  • Save islandjoe/0354a697997322b6595851b31d491394 to your computer and use it in GitHub Desktop.
Save islandjoe/0354a697997322b6595851b31d491394 to your computer and use it in GitHub Desktop.
Fibonacci Series in Python
def fibo(n):
prev = n - 2
current = n - 1
base_case = (n == 1 or n == 0)
return n if base_case else fibo(prev) + fibo(current)
for n in range(10):
print(fibo(n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment