Question: I need help with the following function in python ASAP. Thank you ! Question 6: Function Compositions Suppose you are the grader for a homework
I need help with the following function in python ASAP. Thank you !

Question 6: Function Compositions Suppose you are the grader for a homework assignment. You have two dictionaries, name_to_score and name_to_latedays. name_to_score contains key-value pairs of {student name: student score}, and name_to_latedays contains the key-value pairs {student name: number of days late}. For each day late a student submitted their assignment, their score is adjusted as specified in a helper function fun(). Fill in the missing code in the adjust_score(name_to_score, name_to_latedays) function below to determine grades. This function takes in the dictionaries above and returns a new dictionary adj_scores with student's scores adjusted for any penalties incurred for late submission. You must use the concept of function composition to solve this problem, using repeated calls to fun(). For example, applying this program to: name_to_score = {'Daniel Jackson': 100, Samantha Carter":98, 'Tealc': 60} name_to_latedays = { 'Daniel Jackson':0, 'Samantha Carter':1, 'Teale': 5} fun( score): { adj_score = score - 10 return adj_score } Should output { Daniel Jackson':100, Samantha Carter':88, 'Tealc: 10}. def adjust_score(name_to_score, name_to_latedays, fun): adj_scores = {} for name in name_to_score: days_late = name_to_latedays[name] score = name_to_score[name] adj_scores[name] = score return adj_scores
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
