Hello,
I am trying to make a recursive function that will return a list but I get a SyntaxError. Here is the code working so far (just an example):
def myfactorial(n): if n == 1: return 1 else: return n * myfactorial(n-1)
myfactorial(10)
I need to return something like this: [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]
I know that there is already a build in factorial function, I created this recursive function only as an example of what I am trying to get: a list. To return a list of all values of a given recursion, the steps of it...
Thank you for your attention.