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]
2 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]2 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
NEED HELP PLEASEE!!!
hjlf
                                                   Start
                                                  Guess
     Incorrect                                                                   Correct
-------------------------              Computer                    ----------------------
- displays incorrect               ------------                    - Displays "Well done"
- displays try again            counts number              - Informs the number of
                                           of guesses                     guesses



hope this helps

make 3 lines down from the start bubble, and do "IF- Then"


6 0
3 years ago
Online platforms that allow users to represent themselves via a profile on a web site and provide and receive links to other net
Ksju [112]

Main Answer:<u> A Social networking service is an online platform that allow users to represent themselves via a profile and web site and provide and receive links to other network members </u>

Sub heding:

What is social networking service?

Explanation:

1.A social networking services is an online platform that allow users to represent themselves via a profile and web site and provide and receive links to other networks members

2.social networking services vary in format and the numbers of features

Reference link:

https//brainly.com

Hashtag:

#SPJ4

4 0
2 years ago
Placeholders can hold text but not graphics such as photos or charts. True or false?
sasho [114]
False. a placeholder can hold everything 
6 0
3 years ago
Write the use of these computers.
xxTIMURxx [149]

Answer:

i not know mainframe computer there is many use of computer

5 0
2 years ago
Can i have help for a ggogle class room
andrew11 [14]

Answer:

or tell ur teacher to add u in ur class

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Tom's using Google Ads to promote his bicycle store. He's created an Android App and needs to measure how effectively the curren
    14·1 answer
  • Identify at least three body language messages that project a positive attitude?
    15·1 answer
  • Can you know what time someone retweeted
    5·1 answer
  • While working a night job at a call center, Eric creates an app called EatOut, which can be used to place orders at restaurants,
    14·1 answer
  • Henry uses a laptop and has noticed that sometimes when he is typing, the cursor will move, causing him to mistype words or even
    12·1 answer
  • A commercial depicts a teenager on a skateboard vandalizing a brick wall. This is an example of:
    11·2 answers
  • Can somebody help me out
    15·1 answer
  • Question #3
    12·1 answer
  • The cat store needs your help! The base class Animal has private fields animalName, and animalAge. The derived class Cat extends
    9·1 answer
  • Many people are scared of the rise of Artificial Intelligence (AI). Do you think computers that are controlled by an AI are some
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!