Home

"attn.steven.kuo@gmail.com" <attn.steven.kuo@gmail.com> writes:
> Recursion is common in functional programming:
>
> def f(n, l=None):
> if l == None:
> l = []
> if n > 0:
> return f(n/26, l + [n%26])
> else:
> return l
>
> print f(1000)

Right, this is functional style, but quite painful in Python (no tail
recursion, and look at all that list copying).

previous
next

Re: Best programs written completly in Python
Re: Looking for Delaunay triangulation module...
Re: plotting pixels in python
Re: New UI Toolkit
ANNOUNCE: Exscript 0.9.8
Fundacja Avalon
Krwinka
Pajacyk
Fundacja Sloneczko
Fundacja Hobbit