Created
March 2, 2011 12:56
-
-
Save ideamonk/850883 to your computer and use it in GitHub Desktop.
flatten a nasty nested list into a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flatten(listy_list): | |
return ''.join([x if type(x)==type('') else flatten(x) for x in listy_list ]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment