This might be a great place for a generator function: Rather than appending to `course_enrollment_pairs`, you could `yield (course, enrollment)`.

If callers needed to go over the list more than once, they could then capture it as a real list, but otherwise it would be lazy, and only loop over the elements as needed.