Answers for "concatenate all elements in a list into a string"

28

Concatenate Item in list to strings

>>> sentence = ['this','is','a','sentence']
>>> '-'.join(sentence)
'this-is-a-sentence'
Posted by: Guest on April-11-2020
0

how to concate a string to all elements in a list in python

[s + mystring for s in mylist]
Posted by: Guest on February-17-2021

Code answers related to "concatenate all elements in a list into a string"

Python Answers by Framework

Browse Popular Code Answers by Language