["python","line-breaks","file-writing"]
How do I specify new lines in a string in order to write multiple lines to a file?

How can I indicate a newline in a string in Python, so that I can write multiple lines to a text file?
It depends on how correct you want to be. \n will usually do the job. If you really want to get it right, you look up the newline character in the os package. (It's actually called linesep.) Note: when writing to files using the Python API, do not use the os.linesep. Just use \n; Python automatically translates that to the proper newline character for your platform.