Hello all, hoping to be pointed in the right direction if possible.
I'm not quite sure why my code is throwing an error... "Oops, try again. factorial(3) returned 3 instead of 6"
I have a suspicion that there may be something wrong with the way I've denoted 'i' in range() so that it doesn't take all numbers leading up to x into account?
Many thanks in advance
def factorial(x): total = 0 if x > 0: for i in range(x): total = x*(x-i) elif x == 0: return 1 return total