4 ms·
> def tail_factorial(n, accumulator=1): > if n == 0: return 1 > else: return tail_factorial(n-1, accumulator * n) Does this ever return the accumulator? [e
by e12e 9y ago
> def tail_factorial(n, accumulator=1):
> if n == 0: return 1
> else: return tail_factorial(n-1, accumulator * n)
Does this ever return the accumulator?
[ed: ah, no. I see the first comment on the article is about this bug; it should return accumulator, not 1]