<filename>2fibonacci.py
def FibRecursion(n):  
   if n <= 1:  
       return n  
   else:  
       return(FibRecursion(n-1) + FibRecursion(n-2))  
nterms = int(input("Enter the terms? "))  # take input from the user
mylist = []
if nterms <= 0:  # check if the number is valid 
   print("Please enter a positive integer")  
else:  
   print("Fibonacci sequence:")  
   for i in range(nterms):  
       mylist.append(FibRecursion(i)) 
       print(FibRecursion(i))

print(mylist)
<filename>2fibonacci.py
def FibRecursion(n):  
   if n <= 1:  
       return n  
   else:  
       return(FibRecursion(n-1) + FibRecursion(n-2))  
nterms = int(input("Enter the terms? "))  # take input from the user
mylist = []
if nterms <= 0:  # check if the number is valid 
   print("Please enter a positive integer")  
else:  
   print("Fibonacci sequence:")  
   for i in range(nterms):  
       mylist.append(FibRecursion(i)) 
       print(FibRecursion(i))

print(mylist)
# take input from the user # check if the number is valid