Open links in new tab
  1. In Python, you can print multiple items on the same line using various methods. Here are some common techniques:

    Using end Parameter in print() Function

    The print() function has an optional end parameter that specifies what to print at the end. By default, it is set to a newline character (\n). To print on the same line, set end to an empty string or any other character.

    print("Hello", end=" ")
    print("World!")

    Output:

    Hello World!

    Using Multiple Arguments in print()

    You can pass multiple arguments to the print() function, and they will be printed on the same line separated by spaces.

    print("Hello", "World!")

    Output:

    Hello World!

    Using a for Loop

    You can use a for loop with the end parameter to print elements of a list on the same line.

    words = ["Hello", "World!"]
    for word in words:
    print(word, end=" ")

    Output:

    Hello World!

    Using join() Function

    The join() function concatenates elements of a sequence into a single string with a specified separator.

    words = ["Hello", "World!"]
    print(" ".join(words))

    Output:

    Hello World!
    Feedback
  1. How to Print in the Same Line in Python [6 Methods] - Python …

      1. Python Print Without New Line using the print() function with end parameter. …
      2. Python print without new line using the print() function with multiple …
      3. Python print in one line using for loop. The for loop in Python is used to …
      4. Python print on the same in the while loop. We can use the while loop as well …
      5. Python print in the same line using the join() function. We can concatenate …
  2. Python Print Without New Line – Print on the Same …

    Mar 10, 2022 · How to print on the same line in Python. Sometimes, we need to print strings on the same line. This is specially useful when we are reading files in Python. When we read files, we get a blank between lines by default. Let's see …

  3. How to Print without newline in Python? - GeeksforGeeks

    Aug 30, 2024 · In Python, you can use the asterisk (*) operator to unpack a list or tuple and …

  4. Python Print Without New Line – Print on the Same Line

    Sep 3, 2024 · Let‘s look at 5 different ways to print on the same line in Python. We can …

  5. Mastering Python: How to Print and Input on the Same Line

    Here’s how you can use a for loop and end argument to print on the same line: print(i, end=" ") …

  6. Printing on the Same Line in Python - CodeRivers

    2 days ago · In Python programming, the default behavior of the `print()` function is to print …

  7. 5 Best Ways to Print on the Same Line in Python - Finxter

    Mar 7, 2024 · For instance, if you have several variables to print out consecutively, like a, b, …

  8. Python Print on the Same Line: A Comprehensive Guide

    Mar 21, 2025 · This blog post will delve deep into the concept of printing on the same line in …

  9. python - Print new output on same line - Stack Overflow

    Aug 20, 2012 · Help on built-in function print in module builtins: print(...) print(value, ..., sep=' ', …

Refresh