1 00:00:00,000 --> 00:00:03,000 For the next few questions we're given this data structure of courses. 2 00:00:03,000 --> 00:00:08,000 Let's take a couple seconds to go through what it looks like. 3 00:00:08,000 --> 00:00:13,500 It's a dictionary where each key in the dictionary is a hexamester of courses that Udacity offers. 4 00:00:13,500 --> 00:00:16,000 In each hexamester we have another dictionary 5 00:00:16,000 --> 00:00:19,000 that's where the keys are the name of the course, 6 00:00:19,000 --> 00:00:24,000 and within that there's another dictionary with name value pairs. 7 00:00:24,000 --> 00:00:27,000 This is a common way to store data in an unstructured form 8 00:00:27,000 --> 00:00:32,000 where we just have an attribute like name, teacher, assistant, whatever-- 9 00:00:32,000 --> 00:00:35,000 prereq down here--and then a value for that attribute: 10 00:00:35,000 --> 00:00:39,000 Building a Search Engine, the name of the TA, etc, etc. 11 00:00:39,000 --> 00:00:42,000 This question asks us to write a function 12 00:00:42,000 --> 00:00:47,000 that determines whether a course is offered during a given hexamester, 13 00:00:47,000 --> 00:00:49,000 and we're going to do that pretty simply. 14 00:00:49,000 --> 00:00:51,000 Before we get started, let's look at the data structure. 15 00:00:51,000 --> 00:00:54,000 What we want to do is, given a hexamester and the name of a course, 16 00:00:54,000 --> 00:00:59,000 we want to determine if that course is a key in the dictionary 17 00:00:59,000 --> 00:01:02,000 to which that hexamester is associated with. 18 00:01:02,000 --> 00:01:04,000 And this is just 1 line of code, actually. 19 00:01:04,000 --> 00:01:08,000 What this line of code does is determine whether or not the course is a key 20 00:01:08,000 --> 00:01:11,000 in the dictionary that we get with the keyword hexamester in our course's data structure.