+ 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
4 Réponses
+ 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.
+ 2
words = ["Python", "fun"]
index = 1
words.insert(index, "is")
print(*words, sep=" ")
>>>
Python is fun
+ 1
Another way would be ;
words = ["python","fun"]
print("{} is {}".format (words[0], words[1]))
0
Thanks sir