Q. What is the correct way to ensure a file is closed automatically?
β
Correct Answer: (C)
Using with statement
Explanation: Using a with statement ensures the file is properly closed after operations.