Problem Setup
Assume that the following code has run already in this session.
courses = ['CHEM 1001 10 Mack', 'CHEM 1002, 10 Srinivasan', 'CHEM 1002 11 Mack', 'BISC 1100 10 Liu', 'BISC 1102 10 Thomson', 'PSC 2001 10 Wolters', 'PSC 2001 11 Rath', 'PSC 2001 12 Cho', 'WSTU 6999 10 Cho', 'WSTU 6999 11 Delaney']
Compose your code here
course_dict['dept_code'] = course_info[0]
course_dict['section'] = course_info[2]
courses_db.append(course_dict)
courses_db = []
course_dict = {}
course_info = course.split()
for course in courses:
course_dict['instructor'] = course_info[3]
print(courses_db)
course_dict['course_num'] = course_info[1]
Python output
>>Python output here...