English

In how many ways can end of file be detected?

Advertisements
Advertisements

Question

In how many ways can end of file be detected?

Very Short Answer
Advertisements

Solution

The end of a text file can be detected in two common ways:

  1. read(), readline() or iteration returns an empty string.
  2. While reading a binary pickle file, pickle.load() raises EOFError.
shaalaa.com
  Is there an error in this question or solution?
Chapter 7: Data File Handling - EXERCISE [Page 145]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 7 Data File Handling
EXERCISE | Q 6. | Page 145
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×