daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Jan 16th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def map_nested_list(self, lst, func=lambda x: x):
  2.     mapped_list = []
  3.     for i in lst:
  4.         if isinstance(i, list):
  5.             i = self.map_nested_list(i, func=func)
  6.         else:
  7.             i = func(i)
  8.         mapped_list.append(i)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top