I passed this FACTORIAL exercise using the following code but I have some confusion.
let;s suppose the number is 5. Now, the factorial of 5 should print 5 * 4 * 3 * 2 * 1. But if we look at the code it only prints 5 * 4. [x * ( x -1)]
How did I still passed the test. Is there anything that I need to understand.
def factorial(x): if x == 1: return 1 else: x = factorial(x-1) * x return x Replace this line with your code.