I keep getting this error message: Oops, try again. factorial(1) returned 0 instead of 1
The code technically works perfectly, as it returns exactly what I want it to. But for some reason, I keep getting this message. Why?
Thank you for your help!
def factorial(x): total = 1 total = x * (x - 1) x -= 1 for loops in range(x - 2): total = (x - 1) * total x -= 1 return total print factorial(4)