Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function grade_stats that accepts as a parameter a list representing the grades given in a course and returns a dictionary mapping each

Write a function grade_stats that accepts as a parameter a list representing the grades given in a course and returns a dictionary mapping each grade to the count of how many were given. For example, if a list grades contains the following: ['A', 'I', 'C', 'C', 'E', 'B', 'A', 'E', 'E', 'A', 'B', 'B', 'B'] The call of grade_stats (grades) should return the following dictionary: {'A':3, 'I': 1, 'C':2, 'E':3, 'B':4} Note that the grades may not always be A, B, C, D, E and I. For example, A- is a valid grade some places as is 3.7. You should treat whatever is in the passed in list as a valid grade. If the passed in list is empty, your function should return an empty dictionary.

Step by Step Solution

3.46 Rating (172 Votes )

There are 3 Steps involved in it

Step: 1

The detailed answer for the above question is provided below Sorting S... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Principles Part 3

Authors: Jerry J. Weygandt, Donald E. Kieso, Paul D. Kimmel, Barbara Trenholm, Valerie Kinnear, Joan E. Barlow

6th Canadian edition Volume 1

1118306805, 978-1118306802

More Books

Students also viewed these Programming questions