Skip to main contentSkip to solution

What is the default file offset position when we open a file in append mode?

Solution

✅ Correct Option: 2

In append mode (such as "a" in C/Python), the file offset is placed at the end of the file. Every write is added after the existing content, and existing data is not overwritten.


Option 1: the beginning is the default offset for read mode ("r") and write mode ("w"). In "w" the file is also truncated first.

Memory trick: "a" for append means "add at the end".

Keyboard Shortcuts

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