A

Admin • 833K Points
Coach

Q. Which of the following function is used to open a file for reading in Python?

  • (A) fopen(file_name, mode)
  • (B) open(file_name, mode)
  • (C) openfile(file_name, mode)
  • (D) open_file(file_name, mode)
  • Correct Answer - Option(B)
  • Views: 29
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

The open() function returns a file object, which has a read() method to read the file contents.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.