Recursive algorithms anyone?

piet at cs.uu.nl piet at cs.uu.nl
Thu Jun 7 10:25:49 EDT 2001


def add(x,k):
    if type(x)==type([]):
        return additem(x,k)
    return x+k

def additem(l,k):
    return [add(x,k) for x in l]
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list