+ 1

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 https://www.sololearn.com/discuss/2185400/?ref=app

1st Mar 2020, 8:24 AM
Rushikesh Girhe
4 ответов
+ 4
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.
1st Mar 2020, 8:37 AM
John Wells
John Wells - avatar
+ 2
words = ["Python", "fun"] index = 1 words.insert(index, "is") print(*words, sep=" ") >>> Python is fun
2nd Mar 2020, 9:31 AM
Shen Bapiro
Shen Bapiro - avatar
+ 1
Another way would be ; words = ["python","fun"] print("{} is {}".format (words[0], words[1]))
3rd Mar 2020, 10:57 PM
Mr Smith
Mr Smith - avatar
0
Thanks sir
1st Mar 2020, 8:48 AM
Rushikesh Girhe