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
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 admin@deexams.com . See your article appearing on the dEexams.com main page and help others to learn.