Skip to content

Instantly share code, notes, and snippets.

@sameerg07
Created June 4, 2021 03:41
Show Gist options
  • Save sameerg07/1ef0eda3fe9875b0a01e46809d4bc62a to your computer and use it in GitHub Desktop.
Save sameerg07/1ef0eda3fe9875b0a01e46809d4bc62a to your computer and use it in GitHub Desktop.
fibonacci series generation for N numbers
def fibonacci(n):
if n == 1 or n == 2:
return n-1
else:
return fibonacci(n-1) + fibonacci(n-2)
n = int(input())
i = 1
while i <= n:
print(fibonacci(i))
i+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment