DEV Community

Discussion on: Dead Simple Python: Working with Files

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Hmm, I appear to be doing exactly that? I'm not sure what you mean.

lines = [
    "Finally back safe and sound\n",
    "from one of the weirdest days\n",
    "at Gravity Falls.\n"
]
with open("journal3.txt", 'w') as file:
    file.writelines(lines)