Question: grades = [ # First line is descriptive header. Subsequent lines hold data [['Student', 'Test 1', 'Test 2', 'Test 3'], ['Thorny', '100', '90', '80'], ['Mac',

grades = [ # First line is descriptive header. Subsequent lines hold data

[['Student', 'Test 1', 'Test 2', 'Test 3'], ['Thorny', '100', '90', '80'], ['Mac', '88', '99', '111'], ['Farva', '45', '56', '67'], ['Rabbit', '59', '61', '67'], ['Ursula', '73', '79', '83'], ['Foster', '89', '97', '101']]

using python 3[3.6] answer this question

**Exercise 6** (`avg_grades_by_assignment_test`: 1 point). Complete the function `build_avg_by_asn`, which takes `grades` as a parameter and returns a dictionary, `avg_by_asn`, which maps each test to its average score. You may find solutions to earlier exercises useful for completing this one. Feel free to use them!"}]

here is the answer that I put but it says it wrong

grades = [ # First line is descriptive header. Subsequent lines hold

Exercise 6 (avg_grades_by_assignment_test: 1 point). Complete the function build_avg_by_asn, which takes grades as a parameter and returns a dictionary, avg_by_asn, which maps each exam to its average score. You may find solutions to earlier exercises useful for completing this one. Feel free to use them! The demo cell below should display {'Exam 1': 75.66666666666667, 'Exam 2': 80.33333333333333, 'Exam 3': 84.83333333333333} In [96]: def build_avg_by_asn(grades): from statistics import mean for x in grades[1:]: if not any (grades): return None else: avg_by_asn = {n: mean(G) for n, G in grade_lists.items()} return avg_by_asn In [97]: avg_grades_by_assignment = build_avg_by_asn(grades) avg_grades_by_assignment Out[97]: {'Thorny': 90, 'Mac': 99.33333333333333, 'Farva': 56, 'Rabbit': 62.333333333333336, 'Ursula': 78.33333333333333, 'Foster': 95.66666666666667} In [98]; import nb_1_2_tester tester = nb_1_2_tester.Tester_1_2_60) for in range (20): try: tester.run_test(build_avg_by_asn) (input_vars, original_input_vars, returned_output_vars, true_output_vars) = tester.get_test_vars() except: (input_vars, original_input_vars, returned_output_vars, true_output_vars) = tester.get_test_vars() raise print("Passed. Please submit!') AssertionError Traceback (most recent call last) in 3 for in range (20): 4 try: tester.run_test(build_avg_by_asn) 6 (input_vars, original_input_vars, returned_output_vars, true_output_vars) = tester.get_test_vars) except: 5 7 r/tester_6040.py in run_test (self, func)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!