Advertisements
Advertisements
Question
Explain the use of output function write() with an example.
Code Writing
Explain
Advertisements
Solution
write(): Writes one string. It does not add a newline automatically.
with open("data.txt", "w") as file:
file.write("First line\n")shaalaa.com
Is there an error in this question or solution?
