How I get output as phyton is fun | Sololearn: Learn to code for FREE!


How I get output as phyton is fun

Program words = ["Python", "fun"] index = 1 words.insert(index, "is") print(words[0]) print (words[1]) print (words[2]) Output:phython Is Fun But I want output as Python is fun

3/1/2020 8:24:17 AM

Rushikesh Girhe

5 Answers

New Answer


print(words[0], end=" ") displays a space instead of going to the next line. print(words[0], words[1]) displays both words with a space between them.


print ( " ".join(word) )


words = ["Python", "fun"] index = 1 words.insert(index, "is") print(*words, sep=" ") >>> Python is fun


Another way would be ; words = ["python","fun"] print("{} is {}".format (words[0], words[1]))


Thanks sir