I'm using Python 3.7. I want to turn a list of elements into a string by concatenating each element and inserting a string in between them. So if my list consists of
"a", "b", "c"
I would like the result to be
"a-b-c"
I can't find a single Python function to do this. Does one exist? I have resorted to writing this
def concatenate_list_data(list):
result= ''
for element in list:
result += "-"
result += element
return result
but figure there is a more elegant way to do it.