The statement fileobject.seek(10,0) will __________.
The statement fileobject.seek(10,0) will __________.
Solution
✅ Correct Option: 2
The syntax is seek(offset, whence). Here the offset is 10 and whence is 0, which means "from the beginning of the file". So the file object moves to the 10th byte from the start.
Option 1: reverses the roles of the arguments. The first argument is the offset (10), and the second is the reference point (0).
Option 4: this would need whence = 2 (end of file), not 0.
whence values: 0 = start of file, 1 = current position, 2 = end of file.
Related questions:
2026: 19 May Shift 1
2025: 14 May Shift 1
2025: 21 May Shift 1
2025: 20 May Shift 1