πŸ“Š Python
Q. Which of the following is the correct way to open a file for reading?
  • (A) open('file.txt', 'read')
  • (B) open('file.txt', 'r')
  • (C) read('file.txt')
  • (D) file('file.txt', 'r')
πŸ’¬ Discuss
βœ… Correct Answer: (B) open('file.txt', 'r')

Explanation: 'r' mode is used to open a file for reading.

Explanation by: Mr. Dubey
'r' mode is used to open a file for reading.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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