Computer Science

'with' statement ensures that all the resources allocated to the file objects get deallocated automatically.

Python Data Handling

3 Likes

Answer

True

Reason — The 'with' statement ensures that all resources allocated to file objects are deallocated automatically once we stop using the file. In the case of exceptions also, we are not required to explicitly close the file using the 'with' statement.

Answered By

3 Likes


Related Questions