Answers for "how to concatenate a string and a list in python"

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 "how to concatenate a string and a list in python"

Python Answers by Framework

Browse Popular Code Answers by Language