Skip to content

Instantly share code, notes, and snippets.

@ysnerdem
Created November 5, 2017 17:32
Show Gist options
  • Save ysnerdem/34ef365eff62d0c179e18b70da3ba601 to your computer and use it in GitHub Desktop.
Save ysnerdem/34ef365eff62d0c179e18b70da3ba601 to your computer and use it in GitHub Desktop.
def fibonacci(num):
if num <= 1:
return 1
else:
return fibonacci(num-1) + fibonacci(num-2)
num = int(input('How many?:'))
if num <= 0:
print('Enter a positive number.')
else:
for i in range(num):
print(fibonacci(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment