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.

  1. Predict
  2. Try
  3. Observe
  4. Record
  5. Explain
  6. Check

Loading the lab…

About this lab

Behind the experiment.

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.

No screen? Use paper.

The activity sheet has the same steps, a results table and the questions, ready to print.

Printable activity sheet (paper version)All labs

Python file modes: virtual lab · EduFlint