I'm trying to make a x^(n)/n!
string but although it looks simple I have a constraint that is: It must be a recursive function.
What I have so far that I do not even know if it is correct is the following:
def serie(x,n):
if (x and n) < 0:
return 0
elif n = 0:
return 1
else:
Basically the main thing is that I'm not even realizing how I'm going to do it.
Basically my idea would be to multiply x
by itself n
times using perhaps a for or a range (although I do not know if I can use the range command when I'm working with recursion) and then divide by n factorial I was thinking of doing n*n-1*n-2 ....
Until I get to 0 but in this part I have no idea how to do it.