Answers for "how do you write to next line when printing python"

4

python writelines newline

lines = ['line1', 'line2']
with open('filename.txt', 'w') as f:
    f.writelines("%s\n" % l for l in lines)
Posted by: Guest on October-19-2020
6

new line print python

print("Hello World\n" "This is the second line")
Posted by: Guest on October-09-2020

Code answers related to "how do you write to next line when printing python"

Python Answers by Framework

Browse Popular Code Answers by Language