''' DS2000 Spring 2020 Sample code from class: Update the average ACT of incoming Northeastern first-year students with a new score from one student. In this module, we define the function. ''' def update_act(curr_act, num_students, new_score): ''' Function update_act Parameters: curr_act (float/int), num_students (int), new_score (int) Returns: updated ACT average from adding the one new student (float) Does: recomputes average ACT score. Assuming num_students is the number of students currenctly factored into the average. Adds in exactly one more student, with the given score.. ''' curr_total = curr_act * num_students num_students += 1 new_act = (curr_total + new_score) / num_students return new_act