1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-12-08 00:45:29 +01:00
programming-challenges/challenges/fibonacci/solutions/python/function/solution.py

14 lines
290 B
Python
Raw Normal View History

from typing import List
import sys
input_values: List[str] = []
for value in sys.stdin:
input_values.append(value.rstrip('\n'))
def fibonacci(number: int) -> int:
return number if number < 2 else fibonacci(number-1) + fibonacci(number-2)
print(fibonacci(int(input_values[0])))