Editorial Staff - - Python Programming
In this tutorial, we are going to share a Function for nth Fibonacci number. If you are a python beginner and want to start learning the python programming, then keep your close attention in this tutorial as I am going to share a Function for nth Fibonacci number with the output.
To increase your Python knowledge, practice all Python programs, here is a collection of 200+ Python problems with solutions.
Copy the below python program and execute it with the help of python compiler.
1 2 3 4 5 6 7 8 9 10 11 12 13 | def Fibonacci(n): if n<0: print("Incorrect input") # First Fibonacci number is 0 elif n==1: return 0 # Second Fibonacci number is 1 elif n==2: return 1 else: return Fibonacci(n-1)+Fibonacci(n-2) print(Fibonacci(9)) |
34
Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari View all posts by Editorial Staff