Hi

I'm trying to strings to be saved into a textfile, however, it does not put
each string onto each line. So instead looking like this,

First
Second
Third

It looks like this,

FirstSecondThird

What do I need to do to get it to write to the next line?

Many ways, one of cleanest is to use '\n'.join:

strings = '''First
Second
Third'''.split()

with open('output.txt', 'w') as output:
    output.write('\n'.join(strings))

# print it out to test
print(open('output.txt').read())
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.