Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def map_nested_list(self, lst, func=lambda x: x):
- mapped_list = []
- for i in lst:
- if isinstance(i, list):
- i = self.map_nested_list(i, func=func)
- else:
- i = func(i)
- mapped_list.append(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement