Skip to main content

Practice ยท 2 of 3

CSV In, Dicts Out

Implement parse_csv(text) receiving raw CSV text (with a header row) and returning a list of dicts. Then implement to_csv_text(rows, fieldnames) doing the reverse. Use csv module round-trip via io.StringIO.

Difficulty: intermediate

Back to lesson: Practice: Round-Trip Drills