Question: Please code in Python Question 1.4 (10 points) Find the average (mean) hours that each student spends on one of their courses (every week) and
Please code in Python
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
Get step-by-step solutions from verified subject matter experts
