If I have a list of chars:

a = ['a','b','c','d']

How do I convert it into a single string?

a="abcd"

9 Answers
9

Use the join method of the empty string to join all of the strings together with the empty string in between, like so:

>>> a = ['a', 'b', 'c', 'd']
>>> ''.join(a)
'abcd'

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *