def factorial(x): digit_list =  while x > 0: digit_list.append(x) x -=1 y = 1 for digit in digit_list: y *= digit return y
My function creates a list (digit_list), then just multiplies the numbers in the list. I tested with a bunch of different integers and it looks like it returns the correct result each time. I assume there's a more efficient way of achieving the same result (like one that does not require creating a list). I passed the code checker so I can start the next section, but I was curious if there was a correct way, or a different way that we were supposed to complete this exercise? I looked at the hint and didn't quite understand what it was suggesting, so I'm assuming I did not write this the recommended way. Sort of related question. . . as long as it works, does it matter?