Skip to content

Instantly share code, notes, and snippets.

@lawliet89
Created May 10, 2013 12:41
Show Gist options
  • Save lawliet89/5554181 to your computer and use it in GitHub Desktop.
Save lawliet89/5554181 to your computer and use it in GitHub Desktop.
Python concatenate list of string
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