Level 0 / Project 09 - Daily Checklist Writer¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| Concept | This project | — | Quiz | Flashcards | Diagram | Browser |
Estimated time: 25 minutes
Focus¶
- write text output files
Why this project exists¶
Read a list of tasks from a file and generate a formatted checklist with numbered items and checkboxes. This is your first project that writes output files, not just prints to the terminal.
Run (copy/paste)¶
Use <repo-root> as the folder containing this repository's README.md.
cd <repo-root>/projects/level-0/09-daily-checklist-writer
python project.py --input data/sample_input.txt --title "Daily Checklist"
pytest -q
Expected terminal output¶
=== Daily Checklist ===
1. [ ] Review yesterday's notes
2. [ ] Complete Python exercise
3. [ ] Read one chapter of documentation
Checklist written to data/checklist.txt
4 passed
Expected artifacts¶
data/output.txt(formatted checklist)data/output.json(JSON summary)- Passing tests
- Updated
notes.md
Checkpoint: Baseline code runs and all tests pass. Commit your work before continuing.
Alter it (required) — Extension¶
- Add a
--headerflag that puts a custom title at the top of the checklist (e.g. "Monday Tasks"). - Add priority markers -- lines starting with
!get a[!]prefix instead of[ ]. - Re-run script and tests.
Break it (required) — Core¶
- Use an empty task list -- does
format_checklist()return something sensible or crash? - Add tasks with only whitespace -- do blank tasks get numbered or skipped?
- Use a task file with 100+ items -- does the numbering still align correctly?
Fix it (required) — Core¶
- Handle the empty-list case by returning a "(no tasks)" message.
- Ensure
load_tasks()strips whitespace and skips blank lines. - Add a test for the empty-task-list edge case.
Checkpoint: All modifications done, tests still pass. Good time to review your changes.
Explain it (teach-back)¶
- Why does
format_checklist()useenumerate(tasks, start=1)instead of a manual counter? - What does
[ ]checkbox format represent and where is it used (Markdown, GitHub issues)? - Why write the checklist to a
.txtfile instead of JSON? - Where would checklist generation appear in real software (project management tools, daily standup reports)?
Mastery check¶
You can move on when you can: - run baseline without docs, - explain one core function line-by-line, - break and recover in one session, - keep tests passing after your change.
Related Concepts¶
- Collections Explained
- Files and Paths
- How Loops Work
- The Terminal Deeper
- Quiz: Collections Explained
| ← Prev | Home | Next → |
|---|---|---|