Vidyalelo
Python · Q2

Files Handling in Python

Programming · Python · question 2

Q2

What is the purpose of the with statement in file handling?

A.
It ensures that the file is properly closed after usage
Answer
B.
It creates a new file
C.
It reads the file contents
D.
It deletes the file

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board