πŸ“Š Python
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)
πŸ’¬ Discuss
βœ… Correct Answer: (B) open(file_name, mode)

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

Explanation by: Rajeev Malhotra
The open() function returns a file object, which has a read() method to read the file contents.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
185
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Rajeev Malhotra
Publisher
πŸ“ˆ
93%
Success Rate