Whenever you use print
in python, it puts a newline at the end. The thing you should pay attention to is how many newlines are in the output.
"\5"
is just a character (it's the control characters ENQ in ASCII; while it is technically non-printable, my terminal renders it as ♣); printing it outputs whatever your terminal decides to use to render it followed by a newline. print("")
will output a newline. print("\n")
by contrast will output two newlines.
If your terminal can't/won't render \5
(it is a non-printable character after all), print("\5")
will be the same as print("")
.