def fibonacci(n):
          if(n <= 1):
              return n
          else:
              return(fibonacci(n-1) + fibonacci(n-2))
      n = int(input("Enter number of terms:"))
      print("Fibonacci sequence:")
      for i in range(n):
          print(fibonacci(i))
      

      Python language logoRecursive Fibonacci

      beginner
      fucntionCallingItself

      performing Fibonacci series in python using recursion. recursion means a defined function can call itself.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.