Created
November 5, 2017 17:32
-
-
Save ysnerdem/34ef365eff62d0c179e18b70da3ba601 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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