Possible Duplicate:
How can I optimally concat a list of chars to a string?
I have a list of chars:
['h', 'e', 'l', 'l', 'o']
Is there a way to concatenate the elements of such list in a string ‘hello’ that does not require c-like ‘for’ loop? Thanks.
This is the usual way of concatenating strings in Python:
In fact, that’s the recommended way – for readability and efficiency reasons. For example: