Fibonacci Series Using Recursion in Python

(Last Updated On: 14/11/2022)

In this program, we write a python program to print the Fibonacci series using the Recursion method.

Python Program to Print Fibonacci Series Using Recursion

# Print Fibonacci Series Using Recursion in python

#recursive function recur_fibo() is used
def recur_fibo(n):
   if n <= 1:
   	return n
   else:
   	return(recur_fibo(n-1) + recur_fibo(n-2))

num = 10

# check if the number of terms is valid
if num <= 0:
   print("Please enter a positive integer")
else:
   print("Fibonacci Series:")
   
   # Use a for loop to iterate and calculate each term recursively
   for i in range(num):
   	print(recur_fibo(i))

Output:

Fibonacci Series:
0
1
1
2
3
5
8
13
21
34

Leave a Reply

Your email address will not be published. Required fields are marked *