πŸ“Š Python
Q. What is the correct way to ensure a file is closed automatically?
  • (A) Using close() method
  • (B) Using open() method
  • (C) Using with statement
  • (D) Using closefile()
πŸ’¬ Discuss
βœ… Correct Answer: (C) Using with statement

Explanation: Using a with statement ensures the file is properly closed after operations.

Explanation by: Mr. Dubey
Using a with statement ensures the file is properly closed after operations.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
39
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
88%
Success Rate