In this example, you will learn to print output without a newline.
To understand this example, you should have the knowledge of the following Python programming topics:
Using end keyword
# print each statement on a new line
print("Python")
print("is easy to learn.")
# new line
print()
# print both the statements on a single line
print("Python", end=" ")
print("is easy to learn.")
Output
Python is easy to learn. Python is easy to learn.
Using the end keyword, you can append a string at the end of the print text. In the above example, we have passed a space with end, which adds a space at the end of the line and concatenates the content of the next print statement.
Related posts:
Python 3 for Absolute Beginners - Tim Hall & J.P Stacey
Python String isnumeric()
Python Program to Check Whether a String is Palindrome or Not
Python Set symmetric_difference_update()
Python Dictionary keys()
Machine Learning with Python for everyone - Mark E.Fenner
Python String rstrip()
Python @property decorator
Python min()
Python max()
Python String title()
Python Program to Concatenate Two Lists
Python pow()
Python Function Arguments
Python String center()
Python map()
Python Inheritance
Python Set clear()
Python List copy()
Python Program to Display Powers of 2 Using Anonymous Function
Python ord()
Python time Module
Python next()
Python Program to Count the Number of Digits Present In a Number
Python Set intersection_update()
Python Anonymous / Lambda Function
Python Program to Merge Mails
Python Program to Sort Words in Alphabetic Order
Python Set intersection()
Python String format()
Python String istitle()
Python memoryview()