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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post by answerhappygod »

Given Below Is A Function That Returns A Dictionary Of The Number Of Times You Attend A Class In One Week Rearrange The 1
Given Below Is A Function That Returns A Dictionary Of The Number Of Times You Attend A Class In One Week Rearrange The 1 (94.96 KiB) Viewed 16 times
Given below is a function that returns a dictionary of 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 8A': 2, 'CSE 256': 2}. Note that you should make sure the indentation is correct! Drag from here Drop blocks here for subject in subjects: if subject not in subject_freq: subject_freq [subject] = 1 for subjects in timetable.values(): else: subject_freq = {} def subject frequency (timetable): return subject_freq subject_freq [subject] += 1
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply