Question: Write a function named analyse_scores (list_of_scores) that reads a list of scores and determines how many scores are above or equal to the mean and


Write a function named analyse_scores (list_of_scores) that reads a list of scores and determines how many scores are above or equal to the mean and how many are below the mean. The function should print out the analysis in the format specified below. It should print 'Invalid list' if the list is empty Format: Meanffloating point score rounded and displayed to 2 dp usi ng python rounding N above meanfinteger valuej) N below meanfinteger valuej) Your function must produce the output exactly as specified above, with actual values replacing the description inM Note that displaying to 2dp should be interpreted as displaying a mean of 5.0 as 5.00. All mean values should have 2 digits after the decimal point. For example Test Result analyse_scores (I40, 55, 70, 58]) Mean 55.75 N above mean : 2 N below mean 2 analyse_scores ([51, 65, 66, 80, 10, 55]) Mean 54.50 N above mean :4 N below mean 2 analyse_scores([]) Invalid list 1 def analyse_scores(list_of_scores): sum = 0 if len (list-of-scores) 3-1 4 5else: -e: print("invalid list") number-float (len(list_of_scores)) for i in range(len(list_of_scores)) sum list_of_scores[i] mean sumumber mean = float (round(mean, 2)) a = int (sum(! > mean for i in list of scores b-int(sum i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
