Totals per Column From a Real CSV
Finance exports CSV files with a header row. Write /home/student/reports/sum_by.py:
python3 sum_by.py CSV KEY_COLUMN VALUE_COLUMN
Columns are chosen by header name. Values look like 1,234.50: the export quotes fields that contain a comma ("1,234.50"), and some text fields contain commas too. A sample is in /home/student/reports/sales.csv.
KEY TOTAL, with the total to exactly 2 decimals (emea 1234.50), sorted by key.About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Part of Python for DevOps. Next step: Merge Layered JSON Config
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.