Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started