Files
MyAiConfiguration/scripts/benchmarks/tasks/06-refactor-duplication/repo/app/report.py
T
Julian lechnerandClaude Opus 5.5 3480072ed7 test(benchmarks): add A/B task fixtures with hidden checks
Ten small Python tasks, each failing on the fixture and passing with a
reference solution, including workflow expectations for a small change, a
bugfix, and a delegable change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 12:45:40 +02:00

21 lines
623 B
Python

def sales_report(rows):
lines = []
for name, amount in rows:
label = name.strip().title()
value = f"{amount:,.2f}"
lines.append(f"{label:<20}{value:>12}")
total = sum(amount for _, amount in rows)
lines.append(f"{'Total':<20}{total:>12,.2f}")
return "\n".join(lines)
def cost_report(rows):
lines = []
for name, amount in rows:
label = name.strip().title()
value = f"{amount:,.2f}"
lines.append(f"{label:<20}{value:>12}")
total = sum(amount for _, amount in rows)
lines.append(f"{'Total':<20}{total:>12,.2f}")
return "\n".join(lines)