Computer Science - Class 12
Solutions to CBSE Sample Paper - Computer Science Class 12

The correct syntax of seek() is:

(a) [, reference_point])

(b) seek(offset [, reference_point])

(c) seek(offset, file_object)

(d) seek.file_object(offset)



The seek( ) method is used in python to move the file handle to the specified position. 

Syntax: [, reference_point])

So, the correct answer is (a).


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

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.