The Fibonacci numbers are the numbers in the following integer sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation
F_{n} = F_{n1} + F_{n2}
with seed values
F_{0} = 0 and F_{1} = 1.
Method 1 ( Use recursion ) :
def Fibonacci(n):
if n < 0 :
print ( "Incorrect input" )
elif n = = 0 :
return 0
elif n = = 1 or n = = 2 :
return 1
else :
return Fibonacci(n  1 ) + Fibonacci(n  2 )
print (Fibonacci( 9 ))

Method 2 ( Use Dynamic Programming ) :
FibArray = [ 0 , 1 ]
def fibonacci(n):
if n < = 0 :
print ( "Incorrect input" )
elif n < = len (FibArray):
return FibArray[n  1 ]
else :
temp_fib = fibonacci(n  1 ) +
fibonacci(n  2 )
FibArray.append(temp_fib)
return temp_fib
print (fibonacci( 9 ))

Method 3 ( Space Optimized):
def fibonacci(n):
a = 0
b = 1
if n < 0 :
print ( "Incorrect input" )
elif n = = 0 :
return 0
elif n = = 1 :
return b
else :
for i in range ( 1 , n):
c = a + b
a = b
b = c
return b
print (fibonacci( 9 ))

Please refer complete article on Program for Fibonacci numbers for more details!
How do you do the Fibonacci series in Python?
 INPUT FORMAT: Input consists of an integer.
 OUTPUT FORMAT: …
 SAMPLE INPUT: 7.
 SAMPLE OUTPUT: 0 1 1 2 3 5 8.
 PREREQUISITE KNOWLEDGE: while loop in Python and Recursion in Python. …
 Step 1:Input the ‘n’ value until which the Fibonacci series has to be generated.
 Step 3:while (count <= n)
 Step 5:Increment the count variable.
How do you find the nth Fibonacci number in Python?
Solution Review : Compute nth Fibonacci Number
 def fibonacci(n):
 if n <= 1:
 return n.
 else:
 return(fibonacci(n1) + fibonacci(n2))
 print(Fibonacci(4))
What is the Fibonacci Series formula?
F_{n} = F_{n}_{–}_{1} + F_{n}_{–}_{2}. to get the rest. Thus the sequence begins 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … This sequence of Fibonacci numbers arises all over mathematics and also in nature.