From 8c191f1fc98c44ca30343919d00126dd3eccb783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Olsson=20Jarl?= Date: Sun, 30 Aug 2020 10:51:45 +0200 Subject: [PATCH] Added type hints for maths/fibonacci_sequence_recursion. (#2372) --- maths/fibonacci_sequence_recursion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maths/fibonacci_sequence_recursion.py b/maths/fibonacci_sequence_recursion.py index 91619600d..794b9fc0b 100644 --- a/maths/fibonacci_sequence_recursion.py +++ b/maths/fibonacci_sequence_recursion.py @@ -1,7 +1,7 @@ # Fibonacci Sequence Using Recursion -def recur_fibo(n): +def recur_fibo(n: int) -> int: """ >>> [recur_fibo(i) for i in range(12)] [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] @@ -9,7 +9,7 @@ def recur_fibo(n): return n if n <= 1 else recur_fibo(n - 1) + recur_fibo(n - 2) -def main(): +def main() -> None: limit = int(input("How many terms to include in fibonacci series: ")) if limit > 0: print(f"The first {limit} terms of the fibonacci series are as follows:")