promptdojo_

open() — and the with-block AI keeps forgetting — step 8 of 9

Write a small script that:

  1. Writes the string "line one\nline two\n" to /tmp/notes.txt using a with block in write mode.
  2. Reads the file back with another with block and prints its contents stripped of trailing whitespace.

Expected output:

line one
line two

full-screen editor opens — close anytime to keep reading.