Skip to content

Commit 8c191f1

Browse files
authored
Added type hints for maths/fibonacci_sequence_recursion. (TheAlgorithms#2372)
1 parent ab5a046 commit 8c191f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

maths/fibonacci_sequence_recursion.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Fibonacci Sequence Using Recursion
22

33

4-
def recur_fibo(n):
4+
def recur_fibo(n: int) -> int:
55
"""
66
>>> [recur_fibo(i) for i in range(12)]
77
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
88
"""
99
return n if n <= 1 else recur_fibo(n - 1) + recur_fibo(n - 2)
1010

1111

12-
def main():
12+
def main() -> None:
1313
limit = int(input("How many terms to include in fibonacci series: "))
1414
if limit > 0:
1515
print(f"The first {limit} terms of the fibonacci series are as follows:")

0 commit comments

Comments
 (0)