English

Which is the correct syntax for closing a file using Python? -

Advertisements
Advertisements

Question

Which is the correct syntax for closing a file using Python?

Options

  • io.close(file_name, access_mode)

  • file_object.close(file_name)

  • file_object.close()

  • file.file_object.close()

MCQ

Solution

file_object.close()

shaalaa.com
Opening and Closing a Text Files
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×