Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write one function mean_grade(stud_id, results) that accepts as input a student id and a table of study results of various students and units and that

Write one function mean_grade(stud_id, results) that accepts as input a student id and a table of study results of various students and units and that returns as output the mean grade of the student across all his/her units. The input table is expected to contain three columns: unit, student id, grade. You can assume that there is at least one result for the input student id.

For example:

>>> results = [['Database', 101028, 65],

['Database', 101022, 80],

['Operating Systems', 493968, 68],

['Operating Systems', 201022, 59],

['Java Fundamentals', 493968, 45],

['Java Fundamentals', 101022, 85],

['Mathematics', 101022, 71],

['Mathematics', 493968, 67],

['Information Systems', 493968, 75]]

>>> mean_grade(493968, results)

63.75

>>> mean_grade(101022, results)

78.66666666666667

Your solution may not use any imports.

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

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

Students also viewed these Programming questions

Question

explain the use of models in business to business communications

Answered: 1 week ago