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 Program to Get the Full Path of the Current Working Directory
Python Set add()
Python Program to Merge Mails
Statistical Methods for Machine Learning - Disconver how to Transform data into Knowledge with Pytho...
Python del Statement
Python String endswith()
Python if...else Statement
Python Program to Return Multiple Values From a Function
Python frozenset()
Python Inheritance
Python Program to Find Armstrong Number in an Interval
Python sleep()
Python frozenset()
Python Namespace and Scope
Python String isalnum()
Natural Language Processing with Python - Steven Bird & Ewan Klein & Edward Loper
Python Variables, Constants and Literals
Python Anonymous / Lambda Function
Python String rpartition()
Python break and continue
Python Program to Remove Duplicate Element From a List
Python tuple()
Python Program to Add Two Matrices
Python Program to Concatenate Two Lists
Python format()
Learning scikit-learn Machine Learning in Python - Raul Garreta & Guillermo Moncecchi
Python Program to Check if a Number is Positive, Negative or 0
Python Set symmetric_difference()
Python Program to Split a List Into Evenly Sized Chunks
Python dir()
Python Objects and Classes
Python String lower()