Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in PYTHON please Question 1.4 (10 points) Find the average (mean) hours that each student spends on one of their courses (every week) and

Code in PYTHON please image text in transcribed

Question 1.4 (10 points) Find the average (mean) hours that each student spends on one of their courses (every week) and print it in a dict format similar to the inputs (copy/paste this code below): ecse200_hours: dict[str, float] = {"Alpha": 3.5, "Bravo": 6.0, "Charlie": 5.5} ecse202_hours: dict[str, float] = {"Alpha": 4.0, "Bravo": 3.5, "Charlie": 2.0} math141_hours: dict[str, float] = {"Alpha": 5.0, "Bravo": 3.0} # Charlie does not take this course Question 1.5 (18 points) Implement a general version of the algorithm from Q1.4 that takes in the following input: . A list of dicts, each one representing weekly hours spent on this course by each student in the exact same format as Q1.4. Note that the class lists for different courses can differ. The output must be a dict with all students and the average time they spend on one of their courses. If a student did not take a course, do not assume they spend 0 hours on the course for the course (e.g., Charlie's average (mean) from the example above is avg Charlie Charlie's hours Num courses he took 2.0 + 5.5 = 3.75 2 Hints: In general, your algorithm should first find all the student names. Then, like before, use a nested for loop where you iterate over the students and then over each course they took

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

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

0262660709, 978-0262660709

More Books

Students also viewed these Databases questions

Question

internationalization of business?

Answered: 1 week ago