Every line of 'python apply lambda to list' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
7 def _recursive_apply(f, l): 8 if isinstance(l, (list, tuple)): 9 out = [_recursive_apply(f, l_) for l_ in l] 10 if isinstance(l, tuple): 11 out = tuple(out) 12 return out 13 else: 14 return f(l)