1
I’m trying to make a show x^(n)/n!
but although it seems simple I have a constraint that is: It has to be a recursive function.
What I’ve got so far that I don’t even know if it’s right is this::
def serie(x,n):
if (x and n) < 0:
return 0
elif n = 0:
return 1
else:
Basically missing the main one that I don’t really understand how I’m gonna do it.
Basically my idea would be to multiply the x
by himself n
sometimes using maybe a for or a range(although I don’t know if I can use the range command when I’m working with recursion) and then divide by n factorial I was thinking about doing n*n-1*n-2 ....
Until I reach 0 but in this part I have no idea how to do it.