If the list contains some numbers, use map to convert them all to strings.
>>>list = [0,1,2,3,4,5]
>>>map(str,list)
['0', '1', '2', '3', '4', '5']
Also, when you want to separate these elements with "," etc. into one character string, you can write it in one line.
>>>','.join(map(str,list))
'0,1,2,3,4,5'
Convenient when sending data measured by a sensor or the like.
Recommended Posts