Question: python please Define a function named get_average (a_dict) which takes a dictionary as a parameter. The function returns a new dictionary where the keys are
Define a function named get_average (a_dict) which takes a dictionary as a parameter. The function returns a new dictionary where the keys are the same keys as the parameter dictionary but the values are the average of the list of numbers of the corresponding key. Round the average value to 2 decimal places. nion For example: Test Result dict. { 1:51. ''[8), 110, 3, 5, 5 > 1 15.0 result - set_averagela_dict) 13.0 for key in sorted result.keys()) print(key, '', result[key]) Answer: (penalty regime: 0 %) 1 def get_average(a dict): 2 for item in a dict: 3 for key in item: 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
