Skip to main content

Practice · 3 of 3

Acceptance: finance_summary

CHALLENGE
Difficulty: beginner+25 XP

Contract: finance_summary(expenses, budget) returns {"total", "count", "top", "remaining", "warning"} where total is rounded, top is the category with the highest total (tie -> first to reach it; None when empty), remaining = round(budget - total, 2), and warning is True when total > 0.9 * budget else False.

Back to lesson: Practice: Capstone: Core Contract