Python Programming - Reading and Writing Files - Discussion

Discussion Forum : Reading and Writing Files - General Questions (Q.No. 5)
5.
In Python, what does the with statement provide when working with files?
It opens a file in write mode
It automatically closes the file after operations
It reads the contents of a file
It appends data to a file
Answer: Option
Explanation:
The with statement is used for efficient file handling and automatically closes the file when the block is exited.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.