Question: Python Question 3: (20 points) Consider a dictionary where keys are item labels and values are tuples of category labels. Write a function that takes

Python
Python Question 3: (20 points) Consider a dictionary where keys are item

Question 3: (20 points) Consider a dictionary where keys are item labels and values are tuples of category labels. Write a function that takes such a dictionary and a category label as inputs and returns a list of all the items that has that category in their category list. For example, given {":("c1",), "6":("c1","c2","c3"), "c":("c1","c3"), "d":("c2","c3")} and ctg="c2", your function should return ("5", "d"] def item_cats(d, ctg): return Question 4: (25 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!