nth Fibonacci number

sample solution

def fib(n):
    if n==0:
        return 0
    elif n==1:
        return 1
    else:
        fnm1 = 1
        fnm2 = 0
        for i in range(2,n+1):
            fn = fnm1 + fnm2
            fnm2 = fnm1
            fnm1 = fn
    return fn

n = int(input("Which Fibonacci number do you want? "))
print(f"Fibonacci number {n} is equal to {fib(n)}")