Answers for "Python Program to Write Fibonacci Sequence Using Recursion"

5

fibonacci series python recursion

# By recursion
def fib(n):
    if n == 1 or n == 2:
        return 1 
    else:
        return(fib(n-1) + fib(n-2))
        
n = 6
for i in range(1,n+1):
    print(fib(i))
Posted by: Guest on July-24-2021

Code answers related to "Python Program to Write Fibonacci Sequence Using Recursion"

Python Answers by Framework

Browse Popular Code Answers by Language