I want to find the next fibonacci number in the fibonacci series. Like if i entered 9 then the function should return 13 which is next fibonacci number.
i could not understood logic how it can be implemented. Just messing with fibonacci program.
def Fibonacci(n):
if n<0:
print("Incorrect input")
elif n==1:
return 0
elif n==2:
return 1
else:
return Fibonacci(n-1)+Fibonacci(n-2)
print(Fibonacci(9))
if i entered 9 then the function should return 13 which is next fibonacci number.