Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...