πŸ“Š Python
Q. What is the use of the 'with' statement when working with files?
  • (A) To automatically close the file
  • (B) To open multiple files
  • (C) To write to a file
  • (D) To append data
πŸ’¬ Discuss
βœ… Correct Answer: (A) To automatically close the file

Explanation: 'with' ensures that the file is properly closed after its block execution.

Explanation by: Mr. Dubey
'with' ensures that the file is properly closed after its block execution.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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