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
What are some tasks for which you can use the VBA Editor? i need help for my computer class.
Murljashka [212]

Answer:

Visual Basic for Applications runs as an internal programming language in Microsoft Office applications such as Access, Excel, PowerPoint, Publisher, Word, and Visio. VBA allows users to customize beyond what is normally available with MS Office host applications by manipulating graphical-user-interface (GUI) features such as toolbars and menus, dialogue boxes, and forms. You may use VBA to create user-defined functions (UDFs), access Windows application programming interfaces (APIs), and automate specific computer processes and calculations. Macros can automate just about any task—like generating customized charts and reports, and performing word- and data-processing functions. Programmers,like replicating large pieces of code, merging existing program functions, and designing specific languages. VBA can also work in non-Microsoft settings by using a technology called "COM interface," which allows commands to interact across computer boundaries. Many firms have implemented VBA within their own applications, both proprietary and commercial, including AutoCAD, ArcGIS, CATIA, Corel, raw, and SolidWorks.

<em>(Hope this helps/makes sense!)</em>

6 0
3 years ago
Leah and Santana have been requested to print a daily report of scheduled activities. Their supervisor needs to know if each par
Katyanochek1 [597]

Answer:

Boolean

Explanation:

Boolean is one of the primitive data types that will only hold either true or false value. This data type is commonly used in a variable that will track a status with only two possible outcomes.

For example, the<em> ParticipantPD</em> field is to track the payment status (paid or unpaid) of a participant. So, declare the<em> ParticipantPD</em> field as boolean data type will meet its purpose.

               boolean ParticipantPD = true;

               or

               boolean ParticipantPD = false;

8 0
3 years ago
My duties included reviewing
ycow [4]

Answer:

Please check the explanation.

Explanation:

I carried my logical and administrative skills to stand in implementing the succeeding tasks allocated to me:

  • swotting acquiring trends
  • investigating client data
  • concocting yearly inclination reports.

The bullets and numbering and proper indentation make the reading stuff more easily understandable. And that is what we have done above.

4 0
3 years ago
A _____ is a type of legal protection for which person can apply to protect an invention or a discovery.
shepuryov [24]

Answer:

patent

Explanation:

A patent is an intellectual property, with this legal protection, we can exclude to use, sell, and importation of an invention for a limited period of years, but we must do an enabling public disclosure of the invention or discovery, it is a requirement of the patent law, a patent is considered an advantage in the industries world.

3 0
3 years ago
Give a regular expression for binary numbers. They can be integers or binary fractions. A leading - sign is always allowed. Lead
Dmitry_Shevchenko [17]

Solution :

We have to provide an expression for the binary numbers. There can be binary fractions or integers. Whenever there is leading 0, it is not allowed unless the integer part is a 0.

Thus the expression is :

$(-+ \in )$ $[(1+10+11+100+101+110+111)(,000+,001+,010+,011+,111+,100+,101+,110)^*$ $(\in +.(0+1)^*(0+1))+(0.(0+1)^*(0+1))]$

6 0
2 years ago
Other questions:
  • which student organization helps students with career development by having them become interms to sponsor conferences?
    9·1 answer
  • Why is timbre an important musical element?
    7·2 answers
  • Due to the internal style sheets of some browsers, your website may look different to someone who is using firefox as opposed to
    11·1 answer
  • To color the h2 heading, what tag would you use?
    6·1 answer
  • When you open a browser window, it open in a _____. <br> a. fieldb. folderc. menud. window?
    7·1 answer
  • A local cinema allows customer to make a movie ticket reservation. A customer can be
    6·1 answer
  • Write a program that passes an unspecified number of integers from command line and displays their total.
    5·1 answer
  • TO Cloud
    10·1 answer
  • Write the translator of third generation language​
    11·1 answer
  • What is the decimal number 86 when written as a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!