Recursion

Gerhard Häring gerhard.nospam at bigfoot.de
Mon Jan 1 16:37:46 EST 2001


The highest value that works for me (Python 2.0/Linux x86) is 999L. Adding L
to a number makes it of type 'long' instead of type 'int'. Perhaps Perl and
Ruby do automatically use long when necessary.

On Mon, 1 Jan 2001 15:54:13 -0500, Bob Calco <rcalco at cortechs.com> wrote:
>PYTHON
>======
>import sys
>
>def factor(n):
>  if n == 1:
>    return 1
>  else:
>    return n*factor(n-1)
>
>print factor(int(sys.argv[1]))

-- 
mail:   gerhard <at> bigfoot <dot> de
web:    http://highqualdev.com



More information about the Python-list mailing list