Skip to main content

Practice · 2 of 3

CSV In, Dicts Out

CHALLENGE
Difficulty: intermediate+25 XP

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.

Back to lesson: Practice: Round-Trip Drills