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

Lesson 6 of 7

Read a real CSV

CSV is the universal exchange format of spreadsheets. Python's csv module reads it cleanly (better than a naive split).

csv.reader(io.StringIO(text)) walks the lines; next(reader) skips the header row.

import csv, io
reader = csv.reader(io.StringIO(data))
next(reader)  # skip the header
for row in reader:
    print(row[0])

🎯 Your goal

Read DATA with csv.reader: skip the header with next(), collect all rows into the rows list, then print the number of rows.

PRO lesson

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

Discover PRO