πŸ“Š Python
Q. What will happen if you call read() after reaching the end of the file?
  • (A) Raise error
  • (B) Return last line
  • (C) Return empty string
  • (D) Restart from top
πŸ’¬ Discuss
βœ… Correct Answer: (C) Return empty string

Explanation: read() returns an empty string when the file pointer is at EOF.

Explanation by: Mr. Dubey
read() returns an empty string when the file pointer is at EOF.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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