iratxe iratxe - 10 months ago 22
Python Question

Convert a list of characters in a single List , using a List comprehension

I have this list :

listOfWords = ["this","is","a","list","of","words"]

and I need to have
[this is a list of words]
, with a List comprehension.


You mean a list with a single string item?

>>> [' '.join(["this","is","a","list","of","words"])]
['this is a list of words']