Skip to content

Language

Sign in

← Back to the lesson

Computer science · Class 12 · virtual lab

Python file modes

Goal: See what the open() modes r, w, a and r+ do to a text file that exists or is missing.

Six steps: predict, try, observe, record, explain and check. The Record step adds a row to your observation table, and the Check step scores your quick quiz.

Loading the lab…

What this lab simplifies
  • The file holds the text 'hello world' to start with.
  • Only text mode and four modes are shown.
  • The file is imagined; nothing is written to your computer.
Chapters that use this lab (1)

Printable activity sheet (paper version)

Ask Flint AI
Python file modes · EduFlint