Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def flatten(source):
- result = []
- for e in source:
- if isinstance(e,list):
- result.extend(flatten(e))
- else:
- result.append(e)
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement