#------------------------------------------------------------------------------ # Fibonacci2.py #------------------------------------------------------------------------------ def fib(n): """ recursive version of Fibonacci function returns the nth Fibonacci number, not the whole list """ if n==0: return 0 elif n==1: return 1 else: return fib(n-1)+fib(n-2) # end fib() #-- main program -------------------------------------------------------------- n = int(input('Enter the index of a Fibonacci number: ')) print(fib(n))