I know a code that works, but I can't seem to figure out why this code only returns 0. Can anyone help me fix this?
def factorial(x):
hold = 1
count = x
if x == 0:
return 1
else:
while count > 0:
count -= 1
hold *= count
return hold
holdto 1.