How to Print without newline in Python? Last Updated : 26 Apr, 2025 Comments Improve Suggest changes Like Article Like Report In Python, the print() function adds a newline by default after each output. To print without a newline, you can use the end parameter in the print() function and set it to an empty string or a space, depending on your needs. This allows you to print on the same line. Example: Python print("geeks", end =" ") print("geeksforgeeks") Outputgeeks geeksforgeeks Explanation: In the first print() statement, end=" " is used, which means a space (" ") is printed instead of the default newline after the word "geeks". The second print() statement prints "geeksforgeeks" immediately after "geeks", on the same line.Using Python joinYou can use the join() method to combine elements of an iterable into a single string and then print it. python a = ["Hello", "World"] print(" ".join(a)) OutputHello World Explanation: " ".join(a) Joins the elements of the list a using a space as the separator, resulting in the string "Hello World".Using asterisk ( * ) operatorIn Python, you can use the asterisk (*) operator to unpack a list or tuple and print its elements without adding a newline between them. Python a = [1, 2, 3, 4, 5, 6] print(*a) Output1 2 3 4 5 6 Explanation: The * operator unpacks the list, passing its individual elements as separate arguments to the print() function. This prints the list elements separated by spaces.Using Python sys ModuleTo use the sys module, first, import the module sys using the import keyword. Then, make use of the stdout.write() method available inside the sys module, to print your strings. It only works with string If you pass a number or a list, you will get a TypeError. Python import sys sys.stdout.write("GeeksforGeeks ") sys.stdout.write("is best website for coding!") OutputGeeksforGeeks is best website for coding!Explanation: Unlike the print() function, which automatically adds a newline at the end of the output, sys.stdout.write() writes the specified text to the console exactly as it is, without any extra characters (like a newline).Related Articles:Python String join() MethodPython sys Module Comment More infoAdvertise with us Next Article How to Print without newline in Python? U UPENDRA BARTWAL, Follow Improve Article Tags : Misc Python Python Programs Computer Science Fundamentals python-basics +1 More Practice Tags : Miscpython Similar Reads How to Print a List Without Brackets in Python In this article, we will see how we can print a list without brackets in Python. Whether we're formatting data for user interfaces, generating reports, or simply aiming for cleaner console output, there are several effective methods to print lists without brackets.Using * Operator for Unpacking List 2 min read How to Print a Tab in Python In Python, printing a tab space is useful when we need to format text, making it more readable or aligned. For example, when displaying data in columns, we might want to add a tab space between the values for a cleaner appearance. We can do this using simple methods like \t, the print() function or 2 min read Ways to Print List without Quotes - Python The task of printing a list without quotes in Python involves displaying the elements of the list without the default string representation which includes quotes around string elements. For example, given the list a = ['a', 'b', 'c', 'd'], the goal is to print the list in the format [a, b, c, d] wit 2 min read Print new line in Python In this article, we will explore various methods to print new lines in the code. Python provides us with a set of characters that performs a specific operation in the code. One such character is the new line character "\n" which inserts a new line. Pythona = "Geeks\nfor\nGeeks" print(a)OutputGeeks f 2 min read How to Print a Dictionary in Python Python Dictionaries are the form of data structures that allow us to store and retrieve the key-value pairs properly. While working with dictionaries, it is important to print the contents of the dictionary for analysis or debugging.Example: Using print FunctionPython# input dictionary input_dict = 3 min read Print a List of Tuples in Python The task of printing a list of tuples in Python involves displaying the elements of a list where each item is a tuple. A tuple is an ordered collection of elements enclosed in parentheses ( ), while a list is an ordered collection enclosed in square brackets [ ].Using print()print() function is the 2 min read Python - Print the last word in a sentence Printing the last word in a sentence involves extracting the final word , often done by splitting the sentence into words or traversing the string from the end.Using split() methodsplit() method divides the string into words using spaces, making it easy to access the last word by retrieving the last 3 min read Print the Content of a Txt File in Python Python provides a straightforward way to read and print the contents of a .txt file. Whether you are a beginner or an experienced developer, understanding how to work with file operations in Python is essential. In this article, we will explore some simple code examples to help you print the content 3 min read Python Program to Print Hello World When we are just starting out with Python, one of the first programs we'll learn is the classic "Hello, World!" program. It's a simple program that displays the message "Hello, World!" on the screen. Hereâs the "Hello World" program:Pythonprint("Hello, World!") OutputHello, World! How does this work 2 min read Python New Line - Add/Print a new line Adding or printing a new line in Python is a very basic and essential operation that can be used to format output or separate the data for better readability. Let's see the different ways to add/print a new line in PythonUsing \n escape characterThe \n is a escape character and is the simplest way t 2 min read Like