Python Practice › String Programs › Program 19
Build a sentence from a list of words
Write a Python program to create a string from a list of words.
Input
["There", "are", "Many", "Programming", "Language"]
Output
There are Many Programming Language
Approach
" ".join(words).
Solution
words = ["There", "are", "Many", "Programming", "Language"]print(" ".join(words))Output
There are Many Programming Language
Line by line
Line 2
join puts the separator (a space) between the words.
Learn the concept
New to this topic? Read the lesson, then come back.