# recusive factorial with an auxiliary function (go)
# and an accumulating parameter (acc)
def fac(n):
def go(n, acc=1):
if n == 0: return acc
return go(n-1, acc*n)
return go(n)
# driver code
print(fac(5))
To embed this project on your website, copy the following code and paste it into your website's HTML: