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 285 views
2 answers 309 views
2 answers 382 views
1 answer 260 views
2 answers 284 views
...