join characters in string python code example
Example 1: python merge list into string
>>> sentence = ['this','is','a','sentence']
>>> '-'.join(sentence)
'this-is-a-sentence'
Example 2: python string concatenation with separator
>>> strings = ['do', 're', 'mi']
>>> ','.join(strings)
'do,re,mi'