The Fibonacci sequence is 1, 1, 2, 3, 5, 8 etc. The nth Fibonacci number F(n) where n > 2 can be found using F(n) = F(n-2) + F(n-1)
Remember that F(1) = 1 and F(2) = 1
def fib(n):
if n <= 1:
return n
else:
return fib(n-1)+fib(n-2)
fib(28)
def check(f,v):
if f==v:
print(f"Congratulations! {f} has passed the test case")
# TEST_CASE
check(fib(28), 317811)