Created
February 20, 2019 14:18
-
-
Save pysoftware/f268339853c63e8f01b105d357231963 to your computer and use it in GitHub Desktop.
Fibonacci/ Числа фибоначи
This file contains hidden or 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
# Fibonacci recursion | |
# Рекурсия чисел фибоначи | |
def fib(a): | |
# Базовый случай | |
if a <= 1: return a | |
else: return fib(a - 1) + fib(a - 2) | |
print(fib(int(input()))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment