Python: Print without a Newline – A Step Guide

Python print() function will print a newline. However, if you do not want to a newline, how to do? In this tutorial, we will introduce how to do.

Python: Print without a Newline - A Step Guide

1.Set end=””

Here is an example:

print("I am a sentence", "I am also a sentence", sep="; ", end="")

Run this code, you will see:

I am a sentence; I am also a sentence