If I have a list of chars:
a = ['a','b','c','d']
How do I convert it into a single string?
a = 'abcd'
Use the join method of the empty string to join all of the strings together with the empty string in between, like so:
join
>>> a = ['a', 'b', 'c', 'd'] >>> ''.join(a) 'abcd'
2.1m questions
2.1m answers
60 comments
57.0k users