Created
May 10, 2013 12:41
-
-
Save lawliet89/5554181 to your computer and use it in GitHub Desktop.
Python concatenate list of string
This file contains 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 list_to_string(lst, delim=''): | |
"""Concatenate a list of strings to one single string. Specify a delimiter to append to end of each fragment""" | |
return reduce((lambda a, b: a + delim + b), lst) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment