Solveeit Logo

Question

Computer Science Question on file handling

Match List-I with List-II:List-IList-II
(A) f.seek(-10,1)(I) From beginning of file, move 10 bytes forward
(B) f.seek(10,1)(II) From current position, move 10 bytes backward
(C) f.seek(10)(III) From current position, move 10 bytes forward
(D) f.seek(-10,2)(IV) From end of the file, move 10 bytes backward
A

(A) - (I), (B) - (II), (C) - (III), (D) - (IV)

B

(A) - (II), (B) - (III), (C) - (IV), (D) - (I)

C

(A) - (III), (B) - (II), (C) - (IV), (D) - (I)

D

(A) - (II), (B) - (III), (C) - (I), (D) - (IV)

Answer

(A) - (II), (B) - (III), (C) - (I), (D) - (IV)

Explanation

Solution

The ‘seek()‘ function in Python’s file handling moves the file pointer based on the reference point specified.