Time-box: 45–60 minutes
Milestone: three pure functions calculate a rounded-up fare share, remaining money,
and a budget label without reading input or changing outside state.
Companion learning path: Python From First Principles. If Python or Git is not ready yet, use the free installation guide.
On GitHub, select Use this template → Create a new repository, then clone your new repository and work in that copy. The starting red checks are intentional; your goal is to turn them green and complete the two human-review gates in MASTERY.md.
- integer arithmetic for exact small-unit money;
- parameters, returns, validation, and boundary branches;
- reading a focused
unittestfailure; - keeping calculations separate from printed output.
From this directory, run:
python3 -B -I tests/run_tests.pyThe untouched starter has exactly three intentional failures, all named
test_todo_.... The validation tests should pass. Work only in
fare_budget.py and replace each NotImplementedError with behaviour.
Use these contracts:
fare_share(fare_cents, riders)returns the whole-cent amount each rider should contribute, rounded up so the fare is covered;money_left(income_cents, costs_cents)returns a negative value when costs exceed income;budget_label(left_cents)returns"over budget","balanced", or"within budget".
bool is a subclass of int in Python, but True is not a sensible money amount or
rider count. Keep the supplied validation that rejects it.
fare_share(1_000, 3)is334, and zero fare is supported.- A rider count must be a positive whole number.
- Fare, income, and costs must be non-negative whole cents.
- Remaining money may be negative.
- All three label boundaries are correct.
- The functions return values and never call
input(). python3 -B -I tests/run_tests.pyexits successfully.
Finish with MASTERY.md.
-
Create your own copy from this template.
-
Read MASTERY.md, then create an attempt branch:
git switch -c attempt/my-project
-
Build the project and run the same check GitHub uses:
python3 -B -I tests/run_tests.py
-
Commit and push the attempt branch:
git add . git commit -m "Complete project attempt" git push -u origin attempt/my-project
GitHub Actions grades every pushed attempt automatically. PASS — NAILED IT means every required check passed. REVISE — KEEP BUILDING means the run shows what to fix before you push again. You do not need the KODE Ń VIBE owner to review or start anything; the template's main branch stays quiet on purpose.
The free grading guide explains the result and its limits.