Same Line | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Same Line

is there a way that i can get all of this to go across on one line instead of going down https://code.sololearn.com/c9sDNX4e34xz/#py

16th Jun 2020, 6:38 AM
rodney
rodney - avatar
3 Answers
+ 3
By default python’s print() function ends with a newline. Python’s print() function comes with a parameter called ‘end’. By default, the value of this parameter is ‘\n’, i.e. the new line character. You can end a print statement with any character/string using this parameter. EXAMPLE: ends the output with a <space>  print("Welcome to" , end = ' ')  print("SOLOLEARN", end = ' ') Output : Welcome to SOLOLEARN
16th Jun 2020, 7:20 AM
SOUMYA
SOUMYA - avatar
+ 1
Print("something",end=''") Allows you to print without going to the next line
16th Jun 2020, 6:44 AM
JME
- 1
while I'm laying in bed trying to sleep I ended up figuring out but y'all way seems easier.
16th Jun 2020, 9:09 AM
rodney
rodney - avatar