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

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

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

Post 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 24 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:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply