Advertisements
Advertisements
Question
How is write() different from writelines()?
Very Short Answer
Advertisements
Solution
write() writes one string to a file. writelines() writes a sequence of strings, such as a list or tuple. Neither method automatically adds a newline character; \n must be included explicitly.
shaalaa.com
Is there an error in this question or solution?
