Fibonacci Numbers


This is a companion discussion topic for the original entry at https://toph.co/p/fibonacci-numbers

What is wrong with this? It says, ‘CPU time exceed’.

n = int(input())
def Fibonacci(n):
    if n == 1:
        return 1
    elif n == 2:
        return 1
    else:
        return Fibonacci(n-1)+ Fibonacci(n-2)
print(Fibonacci(n))

Recursion performs slower.
Use for loop.