How to suppress the newline after a print statement in Python

Suppressing the newline after a print statement goes through a list and print all the items in the same line. For example, supressing the newline after a print statement in [“this will”, “all be printed”, “on one line”] results in this will all be printed on one line.

Solution for How to suppress the newline after a print statement in Python : You can use print() to suppress the newline after a print statement Use a for-loop to iterate through the list. At each iteration, call print(item, end) with item as the item in the list and end as end=” ” to suppress the newline after the print statement.


how-to-suppress-the-newline-after-a-print-statement-in-python