Merge pull request #393 from purveshmakode24/master

Add Fibonacci Series Using Recursion
This commit is contained in:
Anup Kumar Panwar 2018-10-02 22:49:50 +05:30 committed by GitHub
commit da3af6047e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

16
Maths/fibonacciSeries.py Normal file
View File

@ -0,0 +1,16 @@
# Fibonacci Sequence Using Recursion
def recur_fibo(n):
if n <= 1:
return n
else:
return(recur_fibo(n-1) + recur_fibo(n-2))
limit = int(input("How many terms to include in fionacci series:"))
if limit <= 0:
print("Plese enter a positive integer")
else:
print("Fibonacci series:")
for i in range(limit):
print(recur_fibo(i))