Capabilities of the r, w and a file modes

In Python, the built-in open() function takes a mode string that controls what a program may do with a text file. For each mode below, used on its own as the mode argument, complete the table by typing yes or no in every cell.

ModeCan readCan writeErases existing textCreates a missing file
r
w
a

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More File Input/Output Questions: