Skip to main contentSkip to solution

_____method is used to position the file object at a particular position in a file.

Solution

✅ Correct Option: 2

The seek() method sets the file object's current position. fileobj.seek(offset, reference_point) moves the pointer to the given byte offset. The reference point is 0 for the start of the file (default), 1 for the current position and 2 for the end.


Option 1: tell() only returns the current position of the file pointer. It does not move it, which is the usual mix-up with seek().

Option 3: dump() belongs to the pickle module (pickle.dump()), where it writes an object to a file. It is not a file object method.

move() does not exist for file objects.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question