How to print without a newline or space in Python?

Better Stack Team
Updated on January 26, 2023

To print without a new line, you need to provide one additional argument end and set its value to something other than the default \n which will break the line. You can set it to an empty character for example as shown below.

 
print('Hello', end='')
print(' world')

The output is a single line:

 
Hello world