feat(nadia): Implement average function in src/calculator.py
Outcome: done Changed: src/calculator.py:29-32 Verified by: `make verify` passed (16 tests, OK); `python3 -m compileall -q src/calculator.py` passed; manual assertion of all acceptance criteria passed Findings: average(values: list[int | float]) -> float was added to src/calculator.py:29-32 Open: none Confidence: high - all acceptance criteria met, header present, type annotations present, no comments/docstrings, compile passes, tests pass, manual verification confirms every criterion Typosaurus-Run: 32dcefafeb39422b82cbd65f56833df7 Typosaurus-Node: 7a52f9800aff4d4396b35d10ada3aacf Typosaurus-Agent: @nadia Refs: #11
This commit is contained in:
parent
078766216d
commit
0ce0649fad
@ -20,3 +20,9 @@ def clamp(value: int, low: int, high: int) -> int:
|
||||
|
||||
def clamp_to_byte(value: int) -> int:
|
||||
return max(0, min(255, value))
|
||||
|
||||
|
||||
def average(values: list[int | float]) -> float:
|
||||
if not values:
|
||||
raise ValueError
|
||||
return sum(values) / len(values)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user