Answer:
#here is code in python
#recursive function to find nth Fibonacci term
def nth_fib_term(n):
#if input term is less than 0
if n<0:
print("wronng input")
# First Fibonacci term is 0
elif n==0:
return 0
# Second Fibonacci term is 1
elif n==1:
return 1
else:
#find the nth term of Fibonacci sequence
return nth_fib_term(n-1)+nth_fib_term(n-2)
n=int(input("please enter the term:"))
print(n,"th Fibonacci term is: ")
print(nth_fib_term(n))
Explanation;
Read the term "n" which user wants to know of Fibonacci sequence.If term term "n" is less than 0 then it will print "wrong input". Otherwise it will calculate nth term of Fibonacci sequence recursively.After that function nth_fib_term(n) will return the term. Print that term
Output:
please enter the term:7
7 th Fibonacci term is:
13