A

Admin • 832.27K Points
Coach

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
  • Correct Answer - Option(A)
  • Views: 26
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

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

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.