CodeAgeBy Sitezack
Python for MakersAutomate your data0 XP
Chapter progress0/6

Lesson 7 of 7

Project: the playlist report

Automation mission: turn a raw CSV into a useful report — exactly what data scripts do every day.

Chain the chapter's steps: read the CSV, build dictionaries, compute, filter.

for t in tracks:
    total = total + t["plays"]
    if t["plays"] >= 120:
        popular.append(t["title"])

🎯 Your goal

From DATA: 1) build tracks, a list of dictionaries {"title": …, "plays": …} (plays as an integer); 2) compute total, the sum of plays; 3) store in best the title of the most-played track; 4) build popular, the list of titles with at least 120 plays (in file order). Print total.

PRO lesson

This advanced chapter is part of CodeAge PRO. Unlock it to keep your adventure going.

Discover PRO