In your examples of writelines(), you pass a list containing a single string element, but in practice, isn’t the usefulness of writelines() in passing several individual lines in a list?
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"]withopen("journal3.txt",'w')asfile:file.writelines(lines)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In your examples of writelines(), you pass a list containing a single string element, but in practice, isn’t the usefulness of writelines() in passing several individual lines in a list?
Hmm, I appear to be doing exactly that? I'm not sure what you mean.