The correct syntax of seek() is:
(a)
file_object.seek(offset [, reference_point])
(b)
seek(offset [, reference_point])
(c)
seek(offset, file_object)
(d)
seek.file_object(offset)
Answer:
The seek( ) method is used in python to move the file handle to the specified position.
Syntax:
file_object.seek(offset [, reference_point])
So, the correct answer is (a).
Explanation:
In the above syntax,
- offset refers to the number of bytes by which the file object is to be moved.
- reference_point indicates the starting position of the file object. That is, with reference to which position, the offset has to be counted. It can have the following values:
0 - beginning of the file
1 - current position of the file
2 - end of file