πŸ“Š 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

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