Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

def subject_study_hours(subject_log, hour_log, subject): Calculate the total number of study hours for `subject`. :param subject_log: list of strings representing subjects that correspond to weekly study

def subject_study_hours(subject_log, hour_log, subject):
Calculate the total number of study hours for `subject`. :param subject_log: list of strings representing subjects that correspond to weekly study sessions. Each occurrence of a subject has also a corresponding number of study hours in the `hour_log`. :param hour_log: list of integers representing study hours corresponding to each subjet in the subject_log, e.g., [1, 3, 2] :param subject: string, representing a subject :return: integer Example: course_study_hours(['comp', 'math', 'comp'], [1, 3, 2], 'comp') returns 3
Write TWO tests for this subject_study_hours()

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago