diff --git a/Mathematics/fibonacci/python/fibo.py b/Mathematics/fibonacci/python/fibo.py new file mode 100644 index 000000000..bf9f4d28b --- /dev/null +++ b/Mathematics/fibonacci/python/fibo.py @@ -0,0 +1,13 @@ +def recur_fibo(n): + if n <= 1: + return n + else: + return(recur_fibo(n-1) + recur_fibo(n-2)) +nterms = int(input("How many terms? ")) + +if nterms <= 0: + print("Plese enter a positive integer") +else: + print("Fibonacci sequence:") + for i in range(nterms): + print(recur_fibo(i))