Why a new line forms, every time i call print() function in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why a new line forms, every time i call print() function in python?

Check the program below: Code: print("Hello") print("User") Output: Hello User Why not, Output: "Hello User" ?

15th May 2020, 3:13 AM
Arjun P Katwa
Arjun P Katwa - avatar
3 Answers
+ 2
Try using end Code: print("Hello", end=" ") print("User") Output: "Hello User"
15th May 2020, 3:26 AM
deeyae
deeyae - avatar
+ 3
print() function break line once its a default behaviour ,
15th May 2020, 3:16 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 1
Thank u both for immediate help🖒
15th May 2020, 3:33 AM
Arjun P Katwa
Arjun P Katwa - avatar