def factorial(n,fact):
if n!=0:
fact=fact*n
factorial(n-1,fact)
else:
print(fact)
return fact
print(factorial(5,1))
I have done factorial program.but when I am printing it gets 120 but when I am returning it saying none When I am using both i am get only 120.it is not getting 2 120 in my output what go wrong could you explain it. Why it returning none is my question why not 120.
I am not get 120 120.it getting only 120 and none I am getting.why I am getting none.could you explain it to me