Python's print() function always prints a newline in the end. The print() function accepts an optional parameter known as the 'end'. Its value is '\n' by default. We can change the end character in a print statement with the value of our choice using this parameter.
# Print a " " instead of the new line in the end. print("Welcome to",end=" ") print("Python")
Welcome to Python
# Printing a dot in the end. print("Hello world , welcome to dEexams" , end = '.') print("com", end = ' ')
Hello world , welcome to dEexams.com
Anmol on Apr 22, 2020 at 12:04 am
This article is contributed by Anmol. If you like dEexams.com and would like to contribute, you can write your article here or mail your article to firstname.lastname@example.org . See your article appearing on the dEexams.com main page and help others to learn.