Recursion?

Ionel Simionescu ionel at psy.uva.nl
Mon Nov 29 12:29:17 CET 1999


Pierre-Yves Cloutier <pycloutier at videotron.ca> wrote in message
news:38421570.9C3D9AEC at videotron.ca...
| Can I use recursion in python?

Yes.

---

def fact(n):
    if n==1: return 1
    else: return n*fact(n-1)

print fact(10)

---

ionel






More information about the Python-list mailing list