My loop prints only the first row of sales.csv. Why?
29 NovYour `return` sits inside the loop, so it exits after the first row. Move it out:
import csv rows = [] with open('sales.csv') as f: for row in csv.DictReader(f): rows.append(row) print(len(rows))29 Nov