Home »
MCQs »
Python MCQs
The function file_object.close() is used to ___
65. The function file_object.close() is used to ___.
- To open the existing file
- To append in an opened file
- To close an opened file
- None of the mentioned above
Answer: C) To close an opened file
Explanation:
To close a file that has been opened, use the file object.close() function. To accomplish this, the Python language provides the close() method. When a file is closed, the system releases the memory that was allocated to it.