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 286 views
2 answers 310 views
2 answers 383 views
1 answer 261 views
2 answers 284 views
...