Your task
Use the messy file and report repeated IDs. Do not overwrite it. Explain the expected output before running the code.
Hint
Read with csv.DictReader so column names are explicit. CSV values are strings until converted. Keep parsing failures visible.
Worked solution
With retail-orders-messy.csv the result is R01:2. A repeated ID is a review flag; identical rows may be a repeated export, but conflicting records require a source decision.
import csv
with open('retail-orders-messy.csv',newline='',encoding='utf-8') as f:
rows=list(csv.DictReader(f))
from collections import Counter
counts=Counter(r['order_id'] for r in rows)
duplicates={k:v for k,v in counts.items() if v>1}
assert duplicates=={'R01':2}
print(duplicates)Extend the test
Change one input in a disposable copy and predict which check should fail. Restore the original before comparing results.
Try the activity before reading its reference. Keep your sources, commands and assumptions with your work. Companion activities are unsaved self-practice and do not award a certificate or change lesson progress.