Recursive algorithms anyone?

Nick Perkins nperkins7 at home.com
Tue Jun 12 11:15:46 EDT 2001


oops, in my haste to use 'map', i forgot about the k param...

..but this works:


from __future__ import nested_scopes

def additem(k,L):
    def _additem(x):
        if type(x) is type([]) : return map (_additem,x)
        else : return x+k
    return _additem(L)






More information about the Python-list mailing list