im trying to write a recursive function that returns the fibonacci number, but am getting a weird result. here's my code.
def fibonacci(a,b,n):
a =a+b
b = a+b
n= n-2
if n ==0:
print b
return b
elif n ==1:
print a
return a
else:
fibonacci(a,b,n)
x = fibonacci(1,1,7)
print x
i get none as the x value but a legitimate integer as the a or b value, and i don't know why.