Does a blank print statement have any effect on the other print statement(s)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Does a blank print statement have any effect on the other print statement(s)?

https://code.sololearn.com/cTmteH4SCKO2/?ref=app

21st Feb 2021, 4:37 PM
∆BH∆Y
∆BH∆Y - avatar
4 Answers
+ 2
∆BH∆Y exactly what i said , the first print statement sets the value of end to " " , the next statement sets it to "\n".
21st Feb 2021, 4:53 PM
Abhay
Abhay - avatar
+ 1
blank print statement prints a new line as the default argument for one of it's paramter "end" is newline character.
21st Feb 2021, 4:43 PM
Abhay
Abhay - avatar
+ 1
unless you specify an empty string for optional 'end' named argument, a 'blank' print will at least output the default new line character ^^
21st Feb 2021, 4:43 PM
visph
visph - avatar
+ 1
where is the problem? inside loop with blank print you're writing a new line after each item, even if they doesn't end with a new line...
21st Feb 2021, 4:53 PM
visph
visph - avatar