open() — and the with-block AI keeps forgetting — step 8 of 9
Write a small script that:
- Writes the string
"line one\nline two\n"to/tmp/notes.txtusing awithblock in write mode. - Reads the file back with another
withblock and prints its contents stripped of trailing whitespace.
Expected output:
line one
line two
⌘↵ runs the editor.read, then continue.
Write a small script that:
- Writes the string
"line one\nline two\n"to/tmp/notes.txtusing awithblock in write mode. - Reads the file back with another
withblock and prints its contents stripped of trailing whitespace.
Expected output:
line one
line two
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.