Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

fibonacci series using recursion in python

def fibonacci(n):
    if n <= 1:
          return n
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)

n = int(input())
result = fibonacci(n)
print(result)
Source by learning.ccbp.in #
 
PREVIOUS NEXT
Tagged: #fibonacci #series #recursion #python
ADD COMMENT
Topic
Name
3+5 =