Question:

Which error is generated by pickle.load() function when you reach end-of-file while reading from the file?

Show Hint

When using pickle to read from a file, be prepared to handle EOFError, which occurs when the end of the file is reached.
Updated On: Apr 24, 2025
  • EOL error
  • EOF error
  • File doesn't exist
  • No error is generated
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

The pickle.load() function in Python reads the next object from the file. If you reach the end of the file, an EOFError (End of File error) is raised. This error indicates that no more data is available to read from the file.
Was this answer helpful?
0
0