#Author: Michael Neary #Date: 11/22/2016 #File: fib.py #Section: 07 #Description: Compute the nth fibonacci number def fibonacci(n): #base case(s) if n == 1: return 0 elif n == 2: return 1 #recursive case result = fibonacci(n-2) + fibonacci(n-1) return result def main(): x = int(input("Enter nth term of the fibonacci sequence: ")) result = fibonacci(x) print("The", str(x) + "th term is:", result) main()