We've been reading CSV files from scratch -- opening files -- reading lines -- splitting on commas. Now that you understand how all of that works, you get to use a n actual CSV library today that does the hard work for you: csv.DictReader
File soccerplayers.csv
from csv import DictReader
fh = open('soccerplayers.csv')
myreader = DictReader(fh) # creates an object of type DictReader!
# Loop over the rows (each row is a dictionary now!)
for row in myreader:
print('The number of', row['Player'], 'is', row['Number'])
In the above code, we note a few things