Question: A 'dictionary' is a data structure that stores each element in a list as a pair, key:value. for instance, you could have a dictionary of

 A 'dictionary' is a data structure that stores each element in

A 'dictionary' is a data structure that stores each element in a list as a pair, key:value. for instance, you could have a dictionary of pairs consisting of a persons name and their favorite numbers. my_dictionary = {"Bob":[3, 45, 6], "Tina":[32, 5, 9], "Carl":[6, 77, 12]} You will write code that works with 3 dictionaries simultaneously. First is a dictionary of instructors (called instructors) and the classes they teach. Second is a dictionary consisting of students (called students) and classes they are taking. Third is a dictionary called teaches that consists of only a single entry ["instructor":"student"] Your task is to write a function called classDirectory that takes three inputs: the dictionaries instructors, students, and teaches. The return should be a boolean. TRUE if teaches is true, else FALSE. In other words if there is a teacher named Smith and a student named Jones and Smith teaches Jones, then [Smith:Jones] should return TRUE. Logical Constraints: o An instructor can teach only 1 class. Students can enroll in multiple classes. o teaches will contain a single entry of instructor and student

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!