with open("grades.txt","r") as f:
data = f.read()
#print(data,len(data))
#records = data.splitlines()
records = data.split('\n')
#print(records)
for record in records:
print(record.split(':'))
f.close()
['Jones', 'CSC 1301', '4', 'A'] ['Jones', 'CSC 1302', '4', 'A'] ['Jones', 'CSC 2720', '3', 'B'] ['Smith', 'CSC 1301', '4', 'B'] ['Smith', 'CSC 1302', '4', 'B'] ['Smith', 'CSC 2720', '3', 'A'] ['Blake', 'CSC 1301', '4', 'B'] ['Blake', 'CSC 1301', '4', 'B'] ['Blake', 'CSC 1301', '4', 'B'] ['Blake', 'CSC 1301', '4', 'B']
grades = {}
grades['Jones'] = [('CSC 1301',4,'A'),
('CSC 1301',4,'A'),
('CSC 2720',3,'B')]
grades
{'Jones': [('CSC 1301', 4, 'A'), ('CSC 1301', 4, 'A'), ('CSC 2720', 3, 'B')]}