Adding all entries in tuple into one string

Viewed 32
('word1', 'word2')

If I have a tuple, how can I add all of the words in the tuple into one string?

Desired output:

word1 word2
1 Answers

Use str.join:

tpl = ("word1", "word2")

s = " ".join(tpl)
print(s)

Prints:

word1 word2
Related