So I'm learning Python. I am going through the lessons and ran into a problem where I had to condense a great many
nl = "\n"
lines = line1, nl, line2, nl, line3, nl
textdoc.write(line1 + "\n" + line2 + ....)
writelines expects a list of strings, while
write expects a single string.
line1 + "\n" + line2 merges those strings together into a single string before passing it to
Note that if you have many lines, you may want to use