files and i/o — moving data in and out7 / 9
open() — and the with-block ai keeps forgetting
This script logs two events to the same file. AI used "w" for both
writes, so the second open wipes the first line. Fix the mode on
line 5 so both lines end up in the file. The output should be:
started
done
The break is on line 5 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _