0

How to print each statement in a new line when n>1?

The first line of the input contains a number n which represents number of lines From second line there are statements which has to be converted in upper case. Eaxh statement comes in new line. https://code.sololearn.com/cC72588F04NC/?ref=app

4th Dec 2020, 7:32 AM
Sanskriti Garg
Sanskriti Garg - avatar
4 Réponses
+ 9
Hint: don't forget to use .join ;)
4th Dec 2020, 8:13 AM
Piyush
Piyush - avatar
+ 1
If you need to print the statement as a single string you can use join keyword. You have to replace " print(new_statement) " by "print(" ".join(new_statement))". In front of .join you have to put the joining symble space, hyphen, comma etc. In brackets put the list you want to join as a string.
4th Dec 2020, 7:42 AM
Yasara hasini
+ 1
If you want to print each statement in a new line then put "\n" in front of .join
4th Dec 2020, 7:51 AM
Yasara hasini
0
Thankyou ...it works!!
4th Dec 2020, 8:36 AM
Sanskriti Garg
Sanskriti Garg - avatar