LearnFrenzy
Sign in Take a free test

File Handling · File Handling MCQ · Question 10

Reading a file a second time Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 10 Back to Exercise

After f.read() returns the whole file, a second f.read() returns "". How do you read it again?

  • A Call f.reset()
  • B Call f.seek(0) to go back to the start Correct
  • C Call f.read(0)
  • D It is impossible without reopening
Correct Answer: Option B

The position stays at the end until you move it.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links