I hope to convert a list of strings to a list of a long string. For example, I hope to convert ['c++', 'python', 'sklearn', 'java'] to ["'c++', 'python', 'sklearn', 'java'"]. Namely, the original list have some strings, the target list should have a long string which includes the small string.
I have tried the ' '.join([str(elem) for elem in s]), but the results are not in a list.
s = ['c++', 'python', 'sklearn', 'java']
listToStr = ' '.join([str(elem) for elem in s])
print listToStr
The expected output is:
["'c++', 'python', 'sklearn', 'java'"]
The actual output is:
c++ python sklearn java