1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OlgaM077 [116]
3 years ago
14

Course Aggregation Many times, departments are only interested with how students have done in courses relative to a specific maj

or when considering applicants for admission purposes.
For this problem you are given a dictionary where the keys are strings representing student ids and the values are dictionaries where the keys represent a course code and the value represents a grade. Your task is to write a function that given a dictionary of the described format and a prefix for course codes, return a dictionary where each key is a student id and the corresponding value is the average grade of the student only in courses that start with the given prefix.
def course_grader (student_to_grades, course_prefix): ({str, {str, float}}) -> {str, float} I: a dictionary containing the grades of students (as described above) and a course code prefix P: compute and store the average grade of all students only for courses that start with the given course prefix 0: a dictionary of student ids to average grades as described in the Processing step pass
Computers and Technology
1 answer:
nadezda [96]3 years ago
8 0

Answer:

def course_grader(student_to_grades, course_prefix):

   student_grades = dict()

   for key, value in student_to_grades.items():

       grade_score = 0

       for course,grade in value.items():  

           if course_prefix == course:  

               grade_score += grade

                student_grades[key] = grade_score / len(value.keys())

   return student_grades

Explanation:

The course_grader function is a python program that accepts two arguments, the student dictionary and the course prefix. The function returns a dictionary of the student id as the key and the average grade of the student as the value.

You might be interested in
How can I master networking my home/business computer(s) - Tv's - iot devices and make the whole system as secure as possible?
vagabundo [1.1K]

Answer:

you can take guide from

hope this will help you....!

5 0
2 years ago
A toolbar of round buttons that appear when you move the mouse when in Slide Show view id called ____________.A toolbar of round
Alisiya [41]

Answer:

the slide show toolbar is displayed

6 0
3 years ago
Is the cell phone changing our views about polite and impolite behavior? For example,
DochEvi [55]

*This question seems like an opinion based question, but here is my opinion on the matter:

Yes the cell phone is changing our views of what is polite and impolite. It is indeed impolite to talk on your phone while you are ordering a drink at Starbucks, because then you aren't focusing on ordering instead you are focused on your phone call which can interfere with your ordering.

Hope this helps!

8 0
3 years ago
Read 2 more answers
Non related to school but im interested,<br><br> Who here actually watches dream smp be honest
Kamila [148]
I did- but I don’t anymore
3 0
3 years ago
Read 2 more answers
Generally speaking, the _______ the risk, the _______ the potential return or loss
givi [52]
<span>The correct answer is higher for both blank spaces.

We all know the famous saying: "No risk, no reward". What is true is the higher your risk you also have a higher degree of reaping a higher rewards. But the opposite is also true, the more you risk the more you stand to lose. In stockbroker business this is best exemplified, as you can se brokers trying to predict the stock market in order to make greater profits. Gambling is also the good example of this. </span>
6 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose alice, with a web-based e-mail account (such as hotmail or gmail), sends a message to bob, who accesses his mail from g
    10·1 answer
  • Identify the six components of an information system. Which are most directly affected by the study of computer security? Which
    8·1 answer
  • "Because Standard Error and Standard Ouput represent the results of a command and Standard Input represents the input required f
    6·1 answer
  • According to the "multiple-selves" theory, of an online DVD rental service could offer same-day deliveries, so that people who o
    9·1 answer
  • You need to extract data from the system your predecessor created. you discover tables have been created according to the third
    7·1 answer
  • A gas furnace has an efficiency of 75% . How many BTU will it produce from 1000 BTU of natural gas​
    14·2 answers
  • William is an HR manager in a textile-manufacturing firm. He is creating a file on the hours each employee worked during the las
    6·2 answers
  • What is a text based language that can be used to build all kinds of things ????
    9·1 answer
  • Is it okay for potential employers to search your social media for use in determining if you are a fit for the position?
    15·1 answer
  • Match the TCP/IP Layer to a problem that can happen there.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!