What you'll build
A command-line tracker that adds, lists, filters, and saves scholarships. Lists of dictionaries, files, and your first piece of persistence.
Requirements
The must-do parts. If any are missing, we'll ask you to take another pass.
- Lets the user add a scholarship with name, country, deadline, funding type, and status.
- Lists all scholarships in a readable way (one per line, columns aligned).
- Supports filtering by country and by funding type.
- Saves the list to a file on exit, and loads it back on the next run.
- Uses functions to separate concerns — no 80-line
if/elsechains.
Bonus, if you're feeling brave
- Sort by deadline.
- Warn when a deadline is within 14 days.
- Export to CSV with the
csvmodule.
Examples
What your program should look like when it runs. Lines starting with $ are typed by you; the rest is your program.
Example 1 — happy path
$ python tracker.py
PySprout scholarship tracker
1. Add a scholarship
2. List all
3. Filter by country
4. Filter by funding
q. Save and quit
> 1
Name: Mastercard Foundation Scholars
Country: Multiple
Deadline: 2026-09-30
Funding: Full
Status: applying
Saved.Where to start
Copy this scaffold into a new file. You don't have to use it — it's just a friendly nudge.
tracker.py
import json
from pathlib import Path
DATA_FILE = Path("scholarships.json")
def load() -> list[dict]:
if DATA_FILE.exists():
return json.loads(DATA_FILE.read_text())
return []
def save(items: list[dict]) -> None:
DATA_FILE.write_text(json.dumps(items, indent=2))
def menu() -> None:
# TODO: print a menu, dispatch to add/list/filter/quit
pass
if __name__ == "__main__":
menu()How we'll grade it
Four checks, four points. Three or above is passing — we'll ask you to revise anything we can't tick.
| Check | What we look for | Pt |
|---|---|---|
| It runs | Starts cleanly. Drops you into the menu. Quits when asked. | 1 |
| Persists | Survives a restart — scholarships I add today are there tomorrow. | 1 |
| Clean structure | Each user action lives in its own function. No file is over ~120 lines. | 1 |
| Reflection | Your note tells us what you would do differently next time. | 1 |