You could actually put the newlines to good use by reading the entire file into memory as a single long string and then use them to split that into the list of grades.
with open("grades.dat") as input:
grades = [line.split(",") for line in input.read().splitlines()]
etc...