Advertisement
Advertisement


How to convert list to string


Question

How can I convert a list to a string using Python?

2019/09/14
1
818
9/14/2019 7:41:45 PM


>>> L = [1,2,3]       
>>> " ".join(str(x) for x in L)
'1 2 3'
2017/03/22

L = ['L','O','L']
makeitastring = ''.join(map(str, L))
2016/09/07

Source: https://stackoverflow.com/questions/5618878
Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Email: [email protected]