Page 1 of 1

Question 3 Given below is a function that returns a dictionary the number of times you attend a class in one week. Rearr

Posted: Mon Jun 06, 2022 6:01 pm
by answerhappygod
Question 3 Given Below Is A Function That Returns A Dictionary The Number Of Times You Attend A Class In One Week Rearr 1
Question 3 Given Below Is A Function That Returns A Dictionary The Number Of Times You Attend A Class In One Week Rearr 1 (59.73 KiB) Viewed 26 times
Question 3 Given below is a function that returns a dictionary the number of times you attend a class in one week. Rearrange the lines of code below so that the function works as expected. For example, if the input parameter is time_table = {"Mon": ['CSE 170'], "Tue":['CSE 8A', 'CSE 256'], "Wed": ['CSE 170'], "Thu": ['CSE 8A', 'CSE 256'], "Fri": ['CSE 170']}, then this function should return {'CSE 170ยน: 3, 'CSE SA': 2, 'CSE 256': 2}. Note that you should make sure the indentation is correct! Drag from here Drop blocks here if subject not in subject_freq: subject_freq[subject] = 1 subject_freq [subject] += 1 else: subject_freq = {} return subject_freq def subject_frequency (timetable): for subjects in timetable.values(): for subject in subjects: