How to concatenate all items of a list of strings into a string in Python

1 Answer

0 votes
lst = ['python','java','c','c++']

s = '-'.join(lst)

print(s)
    
    
   
    
'''
run:

python-java-c-c++

'''

 



answered Jun 7, 2021 by avibootz

Related questions

2 answers 167 views
2 answers 190 views
2 answers 277 views
1 answer 178 views
...