Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (19k 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 (106k 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.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Aug 26, 2019 in Python by Sammy (47.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...