+ 7

Print() aÄșways moves to the next line. What to do if we don't want to go to a newline nd want to print somethng in da same line

21st Jan 2018, 6:46 PM
SPK
SPK - avatar
11 Answers
+ 17
For Python, use print("your_string", end=""). For more, see https://docs.python.org/3.3/library/functions.html#print
21st Jan 2018, 7:13 PM
David Ashton
David Ashton - avatar
+ 12
@Sriparvathi print() of python or printf() of C?
21st Jan 2018, 7:23 PM
Abhishek Tandon
Abhishek Tandon - avatar
+ 12
mark as best answer so that others can know
21st Jan 2018, 7:42 PM
Abhishek Tandon
Abhishek Tandon - avatar
+ 3
@David Ashton thank you! that worked
21st Jan 2018, 7:38 PM
SPK
SPK - avatar
+ 3
@Infinity print () of python and giving a second parameter end with no value helped as suggested by #David
21st Jan 2018, 7:40 PM
SPK
SPK - avatar
+ 3
oh thanks! @ infinity. didnt know we could mark an answer as best answer until u Said so
21st Jan 2018, 7:44 PM
SPK
SPK - avatar
+ 2
@Gordie in python it does...check this code https://code.sololearn.com/c9HoRB7TFwgw/?ref=app
21st Jan 2018, 7:38 PM
SPK
SPK - avatar
+ 2
@Gordie in python it does...check this code https://code.sololearn.com/c9HoRB7TFwgw/?ref=app
21st Jan 2018, 7:38 PM
SPK
SPK - avatar
+ 2
sorry @gordie
21st Jan 2018, 7:46 PM
SPK
SPK - avatar