Joining a list of words : Join : String PYTHON TUTORIALS


PYTHON TUTORIALS » String » Join »

 

Joining a list of words


word1 = "A"
word2 = "few"
word3 = "good"
word4 = "words"
wordList = ["A""few""more""good""words"]


#Joining a list of words
sentence = "Second:"
for word in wordList:
    sentence += " " + word
sentence += "."
print sentence



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo String
» Join