There was no way to make a character string unexpectedly, so it's rudimentary
l = ['a', 'b', 'c', 'd', 'e']
a = ' '.join(l)
print(a)
Output result
'a b c d e'
** The string to be combined must be (str type). ** ** If the element is a numeric value, it needs to be converted to str type by, for example, map () function.
b = '_'.join(map(str, l))
print(b)
Output result
'1_2_3_4_5'
Recommended Posts