See the notes
cat ~/learn/todo.txtYou are here: Practice · To-do
A file is notes the program can reread
Until now the phone forgot when the script ended. A file is how a program leaves a sticky note on disk. Week 3 work. If files still feel new, write one line and stop.
A script that asks “What do you need to do?” and appends that line to a file such as todo.txt in ~/learn.
Get the text with input. Open a file in add-on mode. Write the line. Close. Then run cat todo.txt in the shell to see it without Python.
Open, write, close is a tiny recipe. Later you will wrap that recipe in a function so you can reuse it. Not required today.
Wrong folder. You are not standing in ~/learn. Run pwd. If the file exists but looks empty, you opened it in a mode that replaces instead of adding. Ask Grok about append versus write, using a notebook example.
cat ~/learn/todo.txtAsk the phone how full the battery is.