Answers for "python why is join a string method"

28

what is join use for in python

>>> 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