Answers for "how to join strings"

28

python merge list into string

>>> sentence = ['this','is','a','sentence']
>>> '-'.join(sentence)
'this-is-a-sentence'
Posted by: Guest on April-11-2020
1

python join strings

text = ['Python', 'is', 'a', 'fun', 'programming', 'language']

# join elements of text with space
print(' '.join(text))

# Output: Python is a fun programming language
Posted by: Guest on August-24-2021

Python Answers by Framework

Browse Popular Code Answers by Language