
Boss
Boss: Ledger Pipeline

Boss Fight!
Every passing test breaks a shield.
The Guild treasurer slides a smudged ledger across the table. Some lines are comments, some are blank, some are just plain broken, and names are spelled in every case imaginable. "Who spent what? I need a report by moonrise."
Build a pipeline of small, pure functions. An entry is a tuple
(member, item, amount).
Assignment
parse(lines)returns a list of entries. Each good line isdate,member,item,amount. Skip blank lines, lines starting with#, lines without exactly 4 fields, and lines whose amount isn't a number (EAFP!). Clean names with.strip().title()and items with.strip(), and turn amounts intofloat.totals(entries)returns a dict mapping each member to their total, each rounded to 2 decimals.ranking(entries)returns member names, biggest total first; equal totals sorted A to Z.report(entries)returns lines like"1. Ada: 42.50", in ranking order.big_items(entries, limit)returns a sorted list of the unique item names that had any single amount abovelimit.
parse(lines)returns a list of entries. Each good line isdate,member,item,amount. Skip blank lines, lines starting with#, lines without exactly 4 fields, and lines whose amount isn't a number (EAFP!). Clean names with.strip().title()and items with.strip(), and turn amounts intofloat.totals(entries)returns a dict mapping each member to their total, each rounded to 2 decimals.ranking(entries)returns member names, biggest total first; equal totals sorted A to Z.report(entries)returns lines like"1. Ada: 42.50", in ranking order.big_items(entries, limit)returns a sorted list of the unique item names that had any single amount abovelimit.
main.py Python sleeping
Press Run to try your code, then Check to test it.