Recursion?
aj10 at my-deja.com
aj10 at my-deja.com
Tue Nov 30 13:20:40 EST 1999
In article <38421570.9C3D9AEC at videotron.ca>,
Pierre-Yves Cloutier <pycloutier at videotron.ca> wrote:
> Can I use recursion in python?
>
> thanks
>
> Pierre-Yves Cloutier
>
>
An example:
--
Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> def f(i):
... print i
... if i==0: return
... f(i-1)
...
>>> f(4)
4
3
2
1
0
>>>
--
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list