0 votes
1 view
in Python by (15.7k points)

If I have a list of chars:

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

How do I convert it into a single string?

a = 'abcd'

1 Answer

0 votes
by (107k points)

To convert a list of characters into the string you can use the join method to join all of the strings together with the empty string in between you can do it like as follows:

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

>>> ''.join(a)

image

Related questions

0 votes
1 answer
0 votes
1 answer
asked Sep 27, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
0 votes
1 answer
asked Aug 26, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...