Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help implementing this function based on the specifications below. def average_grade(adict): Returns the average grade among all students. The dictionary adict has netids

Need help implementing this function based on the specifications below.

def average_grade(adict): """ Returns the average grade among all students.

The dictionary adict has netids for keys and numbers 0-100 for values. These represent the grades that the students got on the exam. This function averages those grades and returns a value.

Examples: average_grade({'wmw2' : 55, 'abc3' : 90, 'jms45': 86}) returns (55+90+86)/3 = 77 average_grade({'wmw2' : 55}) returns 55 average_grade({}) returns 0 Parameter adict: the dictionary of grades Precondition: adict is dictionary mapping strings to ints """ pass

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

Find an example of a company that has high respect for people.

Answered: 1 week ago

Question

Prepare an ID card of the continent Antarctica?

Answered: 1 week ago

Question

What do you understand by Mendeleev's periodic table

Answered: 1 week ago