Form list of strings from list of chars in Python

时间:2015-11-21 08:53:24

标签: python

I have a list of chars, something like

['t','u','p','l','e']

and I want to create a list of Strings out of it:

['tuple'

I tried to initialise an empty array and append or += to it but this still returns a list of chars. How can I concatenate strings?

1 个答案:

答案 0 :(得分:5)

All you need to join.

In [33]: [''.join(['t','u','p','l','e'])]
Out[33]: ['tuple']