Question:

Which offset of the seek() method in the following is not valid?

Show Hint

The seek() method only supports three offset values: 0 for the beginning, 1 for the current position, and 2 for the end of the file.
Updated On: Apr 24, 2025
  • 0 - is for the beginning of the file.
  • 1 - the middle position of the file.
  • 2 - for the end of the file.
  • 1 - for the current position of file pointer.
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

The seek() method in Python allows you to move the file pointer to a specific position in the file. The valid arguments for offset are 0 (beginning), 1 (current position), and 2 (end of file). There is no valid offset for the "middle" position of the file.
Was this answer helpful?
0
0