Mar-30-2022, 06:25 AM
Either add a newline before your text or (more commonly) make sure all your other lines end with a newline.
print()
automatically puts a newline at the end of whatever it prints unless you override that setting.write()
doesn't automatically add a newline. You need to add them yourself.print("One line") # defaults to newline added f.write("Second line\n") # newline present in the string