WEBVTT 1 00:00:01.730 --> 00:00:03.410 So just before we get started with dictionaries. 2 00:00:03.410 --> 00:00:06.270 I just wanted to give you a bit more of an overview of what we're trying to do in 3 00:00:06.270 --> 00:00:09.030 this section with sets and dictionaries. 4 00:00:09.030 --> 00:00:12.660 So in previous sections we've seen how lists can be used to store lists of 5 00:00:12.660 --> 00:00:15.770 objects, and then we can actually retrieve those objects by their index. 6 00:00:15.770 --> 00:00:17.840 Which is of course the position. 7 00:00:17.840 --> 00:00:18.680 In the list. 8 00:00:18.680 --> 00:00:21.820 In lists it generally used to store similar items. 9 00:00:21.820 --> 00:00:23.020 Although you can store numbers and 10 00:00:23.020 --> 00:00:26.380 strings in the same list if you can think of a good reason for doing so. 11 00:00:26.380 --> 00:00:31.240 Now lists are also ordered sequences so as a result you can interact through 12 00:00:31.240 --> 00:00:33.490 all the items on the list and process them in order. 13 00:00:33.490 --> 00:00:36.190 And of course, we've done that in previous videos. 14 00:00:36.190 --> 00:00:39.390 So in this section, we're going to look at dictionaries and sets, and 15 00:00:39.390 --> 00:00:41.900 they're both actually unordered collections. 16 00:00:41.900 --> 00:00:46.680 They both also guarantee that there will be no duplicates in that collection. 17 00:00:46.680 --> 00:00:51.080 Sets as similar to lists in that they're actually intended for storing similar 18 00:00:51.080 --> 00:00:56.760 items But you can't actually access individual items using an index. 19 00:00:56.760 --> 00:01:01.490 The set is unordered, so an index is meaningless in the context of a set. 20 00:01:01.490 --> 00:01:04.220 You find out more information about that when we get to 21 00:01:04.220 --> 00:01:06.690 the set videos in this section. 22 00:01:06.690 --> 00:01:09.820 So dictionaries on the other hand Are again unordered and 23 00:01:09.820 --> 00:01:11.950 I can take key valued pairs. 24 00:01:11.950 --> 00:01:16.410 Now the values again are not accessed by an index but by means of a key. 25 00:01:16.410 --> 00:01:20.020 So that's part and parcel of discussing dictionaries. 26 00:01:20.020 --> 00:01:23.560 It's gonna give us a good opportunity to introduce two new string methods, 27 00:01:23.560 --> 00:01:25.160 not only the split end joint. 28 00:01:25.160 --> 00:01:26.480 So let's get into dictionaries. 29 00:01:26.480 --> 00:01:29.450 So as I mentioned, dictionaries aren't axis point index, but 30 00:01:29.450 --> 00:01:32.430 they're accessed instead by means of a key. 31 00:01:32.430 --> 00:01:36.200 Probably the best way to give you more information about this is to show 32 00:01:36.200 --> 00:01:36.780 you an example. 33 00:01:36.780 --> 00:01:43.108 I'm going to start typing and we'll start with fruit equals orange. 34 00:01:43.108 --> 00:01:49.780 A sweet orange citrus Fruit. 35 00:01:52.900 --> 00:01:54.220 Apple. 36 00:01:54.220 --> 00:01:59.444 Where I'm putting the colon, good for making cider. 37 00:01:59.444 --> 00:02:04.046 Lemon:a sour 38 00:02:04.046 --> 00:02:09.600 yellow Citrus fruit. 39 00:02:11.430 --> 00:02:12.110 We'll do a couple more. 40 00:02:12.110 --> 00:02:17.972 Grape, a small sweet 41 00:02:17.972 --> 00:02:21.840 fruit growing in bunches. 42 00:02:24.330 --> 00:02:26.465 And the last one let's do lime. 43 00:02:26.465 --> 00:02:31.764 [SOUND] Sour, 44 00:02:31.764 --> 00:02:38.290 green, citrus, fruit. 45 00:02:38.290 --> 00:02:41.880 And so if I do a print fruit and run that first. 46 00:02:46.610 --> 00:02:51.150 So no real surprises there, it's just duplicated what we've typing effectively. 47 00:02:51.150 --> 00:02:56.950 But what we can do to access a particular element, we can type print fruit, 48 00:02:58.810 --> 00:03:02.720 remember we can't use an index number but we can use the key. 49 00:03:02.720 --> 00:03:04.970 So we can type lemon for argument's sake. 50 00:03:04.970 --> 00:03:08.940 Noting that IntelliJ is automatically telling us the elements as we're 51 00:03:08.940 --> 00:03:12.130 typing it, so Apple grape or 52 00:03:12.130 --> 00:03:15.842 stopping typing something [INAUDIBLE] so it's pretty smart. 53 00:03:15.842 --> 00:03:18.960 Looking at the dictionary giving some options. 54 00:03:18.960 --> 00:03:22.460 Type lemon there we run this. 55 00:03:24.750 --> 00:03:26.780 We get a sour yellow citrus fruit. 56 00:03:28.670 --> 00:03:32.680 So the key is lemon, and the description of the information, 57 00:03:32.680 --> 00:03:37.090 the value in other words, is a sour yellow citrus fruit for lemon. 58 00:03:37.090 --> 00:03:40.470 So as you can see we can access individual items by their key by typing, 59 00:03:40.470 --> 00:03:41.750 in this case, lemon, And 60 00:03:41.750 --> 00:03:45.620 in terms of entering them, you can say that we enter a list of keys and valleys. 61 00:03:45.620 --> 00:03:47.640 And the key is separated by a colon. 62 00:03:47.640 --> 00:03:48.990 Not a comma so it's the key. 63 00:03:48.990 --> 00:03:52.810 You can see the orange, apple or lemon, grape and lime in the keys colon. 64 00:03:52.810 --> 00:03:55.620 And then there's the description or the value. 65 00:03:55.620 --> 00:03:58.480 Which is what is associated with that particular key. 66 00:03:58.480 --> 00:04:00.840 And again, we can access individual keys and 67 00:04:00.840 --> 00:04:03.860 individual values by the keys which you saw me do on the screen there. 68 00:04:03.860 --> 00:04:06.090 And probably now looking at this, 69 00:04:06.090 --> 00:04:08.780 you can see that it's easy to see why they are called dictionaries. 70 00:04:08.780 --> 00:04:11.680 And you could use one to store a list of words in their definitions for 71 00:04:11.680 --> 00:04:12.290 argument sake. 72 00:04:12.290 --> 00:04:15.950 And you can also use a dictionary to store different types of information And then 73 00:04:15.950 --> 00:04:19.280 this example I'm about to type in we're gonna store information about a motorboat. 74 00:04:19.280 --> 00:04:21.670 And what we're gonna do is we're gonna create a new file for 75 00:04:21.670 --> 00:04:24.410 this because we're gonna be coming back to the fruit later in the video. 76 00:04:24.410 --> 00:04:26.070 So I'm doing file>new. 77 00:04:26.070 --> 00:04:29.220 Just making sure that's selected up here. 78 00:04:29.220 --> 00:04:34.630 Project file>new Python, and we'll call this one motorbike, and 79 00:04:34.630 --> 00:04:41.080 for this one I'm going to paste in a bit of code to save a bit of time. 80 00:04:41.080 --> 00:04:42.580 So you can see what I've done there. 81 00:04:42.580 --> 00:04:47.590 I've got the make as a key, the model as a key, the color as a key, and 82 00:04:47.590 --> 00:04:50.730 the engine size as a key, and the value as you can see Honda. 83 00:04:50.730 --> 00:04:55.560 250 dream, color is red and engine size is 250 19. 84 00:04:55.560 --> 00:04:58.230 Now, that is a number and not a string. 85 00:04:58.230 --> 00:05:04.960 So, what we can do is then do a print, bike, engine size, and 86 00:05:04.960 --> 00:05:10.600 again, intemijay is helping us there quite helpfully Pointing out the particular key. 87 00:05:10.600 --> 00:05:14.380 And we go print bike color. 88 00:05:14.380 --> 00:05:17.370 And if we're running this, remember that because we've got two files open now, 89 00:05:17.370 --> 00:05:20.250 we need to select over here the relevant file we wanna run. 90 00:05:20.250 --> 00:05:21.159 So [INAUDIBLE] but 91 00:05:21.159 --> 00:05:24.541 that one will actually come up the first time until we've run this at least once, 92 00:05:24.541 --> 00:05:28.450 or what we can do is right-click in here, Making sure that we clicked into the right 93 00:05:28.450 --> 00:05:32.620 window, we can run motorbike and you can see we get 250 and red. 94 00:05:32.620 --> 00:05:36.070 So the engine size correctly comes back as 250 and the color is red. 95 00:05:36.070 --> 00:05:38.830 And now we'd be able to select both options here, dictionary and motorbike, 96 00:05:38.830 --> 00:05:40.970 'cuz we've run them at least once. 97 00:05:40.970 --> 00:05:44.630 So as you can see here the values themselves don't have to be the same type. 98 00:05:44.630 --> 00:05:46.770 So what we can do is we can store the engine sizes and 99 00:05:46.770 --> 00:05:48.850 numbers that you saw in line one. 100 00:05:48.850 --> 00:05:52.450 And the good thing about it is that you're not limited to strings and numbers. 101 00:05:52.450 --> 00:05:55.000 Values can be used with just about any path or object. 102 00:05:55.000 --> 00:05:56.490 Even another dictionary. 103 00:05:56.490 --> 00:05:59.860 So this particular use of a dictionary is like storing records about an object, 104 00:05:59.860 --> 00:06:01.440 in this case, a motorbike. 105 00:06:01.440 --> 00:06:03.980 And although we're storing different types of data, 106 00:06:03.980 --> 00:06:06.280 they're all related to a common object. 107 00:06:06.280 --> 00:06:08.420 So the keys can be also different types of object. 108 00:06:08.420 --> 00:06:11.670 The only restriction is that they must be immutable. 109 00:06:11.670 --> 00:06:15.963 So we can't use a list for example as a dictionary key but we can use as they 110 00:06:15.963 --> 00:06:20.690 are of course which we found out in previous videos, so let's go back to our 111 00:06:20.690 --> 00:06:25.390 fruit, go back to our dictionaries.pie so we can add to a dictionary. 112 00:06:25.390 --> 00:06:32.856 So what we can do is we could type something like fruit, pear equals. 113 00:06:32.856 --> 00:06:39.080 An odd shaped apple. 114 00:06:39.080 --> 00:06:40.040 Print fruit. 115 00:06:40.040 --> 00:06:45.438 So if we do that run it make a drop here by selecting the rock file this 116 00:06:45.438 --> 00:06:48.970 [INAUDIBLE] it's called dictionary because that is what I called it and run it. 117 00:06:49.980 --> 00:06:50.660 We have a look now. 118 00:06:51.830 --> 00:06:53.450 When we can see pair is in here now. 119 00:06:53.450 --> 00:06:55.160 It's an odd shaped apple. 120 00:06:55.160 --> 00:06:58.350 So that's a way to add an entry to the dictionary. 121 00:06:58.350 --> 00:07:02.530 And we need to do it that way because unlike lists there's no method to insert 122 00:07:02.530 --> 00:07:04.280 or append items in a dictionary. 123 00:07:04.280 --> 00:07:07.540 As you can see what we did there we just assigned a new value to the dictionary by 124 00:07:07.540 --> 00:07:08.970 specifying the new key. 125 00:07:08.970 --> 00:07:11.910 And giving it a value, and the rest of it happens automatically. 126 00:07:11.910 --> 00:07:15.320 Now, whether accessing a value or adding a new entry, square brackets 127 00:07:15.320 --> 00:07:19.070 are used after the dictionary name to enclose the key, as you can see there. 128 00:07:19.070 --> 00:07:21.990 So, in other words, if we're printing it out, The case on line 8. 129 00:07:21.990 --> 00:07:24.440 We're selecting the value that we want to print out or 130 00:07:24.440 --> 00:07:29.250 we're creating a new entry we need to put the key in both cases in square brackets. 131 00:07:29.250 --> 00:07:33.700 The other thing that we mentioned was the keys in the dictionary are unique. 132 00:07:33.700 --> 00:07:38.070 So if we assign a value to an existing key you end up producing the value 133 00:07:38.070 --> 00:07:40.935 Rather than adding another entry so it's really important to understand that. 134 00:07:40.935 --> 00:07:45.440 So,again if you assign a value to an existing key we end up 135 00:07:45.440 --> 00:07:49.620 replacing the value rather than creating another entry or adding another entry. 136 00:07:49.620 --> 00:07:57.785 So, going back to that [INAUDIBLE] that's working we can talk fruit, pear, equals. 137 00:07:57.785 --> 00:08:02.783 Great with tequila, 138 00:08:02.783 --> 00:08:06.410 print fruit, if we run that. 139 00:08:07.930 --> 00:08:08.840 You can see we've got pear, 140 00:08:08.840 --> 00:08:13.220 an odd shaped apple, pear, great with tequila at second time we ran it. 141 00:08:13.220 --> 00:08:16.060 We actually over wrote the entry, there's not two entries for pear in there, 142 00:08:16.060 --> 00:08:16.900 there's only the one. 143 00:08:16.900 --> 00:08:21.770 So there's one key but now there's now an updated value, great with tequila. 144 00:08:22.870 --> 00:08:26.570 I'll just fix that typo now that I've seen it. 145 00:08:26.570 --> 00:08:29.850 And probably being more realistic, fruit lime is great with tequila. 146 00:08:29.850 --> 00:08:31.720 I'm not too sure that pear is. 147 00:08:31.720 --> 00:08:33.140 So again, the same example there. 148 00:08:33.140 --> 00:08:36.520 Lime has been updated, as you can see on the screen, to be great with tequila. 149 00:08:37.560 --> 00:08:41.200 Now there's nothing to stop you for reusing a key when you initially create 150 00:08:41.200 --> 00:08:44.330 the dictionary and python won't actually give you an error, but 151 00:08:44.330 --> 00:08:48.150 the behavior will be the same as assigning a new value to an existing key. 152 00:08:48.150 --> 00:08:51.710 So the entry that appears last in the list is the one that will appear 153 00:08:51.710 --> 00:08:54.880 In your dictionary and what i mean by that i come down here i can put 154 00:08:57.080 --> 00:09:02.348 apple even though we got it found on line two we can find it again 155 00:09:02.348 --> 00:09:08.090 [INAUDIBLE] [INAUDIBLE] [INAUDIBLE] You see when we run it, 156 00:09:08.090 --> 00:09:12.660 you see apple has come around and crunchy 157 00:09:14.090 --> 00:09:18.340 That was the last entry that was added on line six which over-rode effectively 158 00:09:18.340 --> 00:09:22.890 the one on line two or to be more precise it just updated the value. 159 00:09:22.890 --> 00:09:27.280 So the first time apple and the value was created good for making cider but 160 00:09:27.280 --> 00:09:28.750 when you go to this entry. 161 00:09:28.750 --> 00:09:31.830 It just updated the value to be round and crunchy. 162 00:09:31.830 --> 00:09:34.750 And note again that Python doesn't give you an error there at all. 163 00:09:34.750 --> 00:09:37.890 But both and Picham will actually give you a warning. 164 00:09:37.890 --> 00:09:39.870 So if we come up here, it actually does tell you. 165 00:09:39.870 --> 00:09:42.420 It says dictionary contains duplicate keys apple. 166 00:09:42.420 --> 00:09:45.940 So even though you saw there's no Python error as such, and 167 00:09:45.940 --> 00:09:48.000 it doesn't crash the program or anything like that, 168 00:09:48.000 --> 00:09:52.380 you will actually get a warning from or Picham about that, which is pretty neat. 169 00:09:52.380 --> 00:09:55.290 And that's just another reason to make sure you are checking these 170 00:09:55.290 --> 00:09:59.430 markers on a regular basis cuz it will help you in your programming 171 00:09:59.430 --> 00:10:01.350 as we established in previous videos. 172 00:10:01.350 --> 00:10:04.440 Now before we have to look at some more ways we can make use of a dictionary 173 00:10:04.440 --> 00:10:06.390 is a few more things that we need to cover. 174 00:10:06.390 --> 00:10:09.980 That's always useful to be able to remove items from collections. 175 00:10:09.980 --> 00:10:12.560 And to do that with a dictionary use the del command. 176 00:10:12.560 --> 00:10:16.400 So down here, for example, if we wanted to delete lemon type del then we 177 00:10:17.600 --> 00:10:20.360 enter the name of the key in brackets. 178 00:10:20.360 --> 00:10:23.830 So for example, lemon would remove that item. 179 00:10:23.830 --> 00:10:29.680 So we can put a print under that The last entry now when we run it, 180 00:10:29.680 --> 00:10:31.570 shouldn't have a lemon there. 181 00:10:31.570 --> 00:10:34.100 So we scroll this over, you'll see we got lima, lemon, and 182 00:10:34.100 --> 00:10:37.290 then lemon has disappeared from the last line of output, 183 00:10:37.290 --> 00:10:42.860 which was of the line of output that was processed after We deleted it on line 14. 184 00:10:42.860 --> 00:10:46.560 Now the del command is a lot more powerful than that example 185 00:10:46.560 --> 00:10:48.250 probably indicates on the screen. 186 00:10:48.250 --> 00:10:50.080 So make sure you use it with care. 187 00:10:50.080 --> 00:10:54.770 So if you forget to specify key to delete, then it removes the entire dictionary and 188 00:10:54.770 --> 00:10:56.530 we therefore get an error when we try to print fruit. 189 00:10:56.530 --> 00:11:01.960 So I went back here, commented that out and just made that Del fruit. 190 00:11:03.100 --> 00:11:06.070 We should get an error on the last line because the entire dictionary no longer 191 00:11:06.070 --> 00:11:07.310 exists because we've deleted it. 192 00:11:07.310 --> 00:11:10.350 And you can see name three is not defined and 193 00:11:10.350 --> 00:11:13.390 it's because it not only totally removed the contents of the dictionary, 194 00:11:13.390 --> 00:11:17.400 it deleted the variable incompletely, and that's why we're getting that error. 195 00:11:17.400 --> 00:11:20.720 So, if you wanted to delete all the entries in the dictionary but 196 00:11:20.720 --> 00:11:23.560 still wanted to retain the dictionary like effectively an empty dictionary so 197 00:11:23.560 --> 00:11:26.560 you could start adding to later, So, it doesn't count venera but 198 00:11:26.560 --> 00:11:29.310 you use something different you use fruit dot clear. 199 00:11:29.310 --> 00:11:33.220 So, you type fruit dot clear like so. 200 00:11:33.220 --> 00:11:35.690 So, if we run that, and fully error at this time and 201 00:11:35.690 --> 00:11:40.390 the contents have been deleted effectively or cleared out. 202 00:11:40.390 --> 00:11:44.530 So, it's now empty waiting for you to process or manipulate it some other way. 203 00:11:44.530 --> 00:11:48.090 So we now know how to create the dictionary, we've added items to it, and 204 00:11:48.090 --> 00:11:51.180 we've removed a single item, and we've also cleared the entire dictionary. 205 00:11:51.180 --> 00:11:54.510 And we've said one way to access the individual item is by specifying the key, 206 00:11:54.510 --> 00:11:57.890 but one problem with accessing items by key occurs 207 00:11:57.890 --> 00:12:01.130 when we try to retrieve an item that doesn't exist. 208 00:12:01.130 --> 00:12:04.470 So if you delete lines, so what I'm gonna do is just delete these lines here, so 209 00:12:04.470 --> 00:12:05.970 we have still got something to work with. 210 00:12:07.610 --> 00:12:11.560 Those it so we still got some items in our dictionary so 211 00:12:11.560 --> 00:12:15.967 if we try to do a print to outside. 212 00:12:15.967 --> 00:12:21.034 Knowing that hasn't made it into a cage it doesn't exist. 213 00:12:21.034 --> 00:12:25.032 >> [NOISE] >> Plus you run that. 214 00:12:26.370 --> 00:12:27.370 Key error tomato. 215 00:12:27.370 --> 00:12:32.350 So it's basically saying the key doesn't exist of key tomato doesn't exist 216 00:12:32.350 --> 00:12:33.240 in the dictionary. 217 00:12:33.240 --> 00:12:34.840 So this is something you may want to do. 218 00:12:34.840 --> 00:12:39.720 You may want to do some testing to check if a particular key is in the dictionary. 219 00:12:39.720 --> 00:12:41.310 And unfortunately we can get around that. 220 00:12:41.310 --> 00:12:43.110 There's a couple of ways we can do it. 221 00:12:43.110 --> 00:12:47.450 What I'll do first is going to modify the program slightly before reading the keys. 222 00:12:47.450 --> 00:12:48.280 So let's go back up here. 223 00:12:48.280 --> 00:12:51.040 I'm gonna remove the second entry cuz we don't need that anymore. 224 00:12:51.040 --> 00:12:54.340 And I'm gonna comment out this code. 225 00:12:57.030 --> 00:13:02.094 And actually what I'll do is I'll leave the last print in, print(fruit). 226 00:13:03.710 --> 00:13:09.240 And let's create some code that allows you to type in the name of the fruit, 227 00:13:09.240 --> 00:13:11.710 and it will try and press us there. 228 00:13:11.710 --> 00:13:16.830 So, we can type while, true, we're gonna try and look it up in the dictionary. 229 00:13:16.830 --> 00:13:19.803 We're gonna type dict_key, dictionary key abbreviated. 230 00:13:19.803 --> 00:13:25.570 Equals input please enter a fruit. 231 00:13:28.864 --> 00:13:34.320 If the dictionary key is equal to quit, we'll break. 232 00:13:35.840 --> 00:13:39.100 So, that just allows us to get out of the loop, but failing that, 233 00:13:39.100 --> 00:13:44.300 it should mean that quit wasn't typed or assigned description 234 00:13:44.300 --> 00:13:51.295 To be equal to fruit.get(dict), and that is using the dict function. 235 00:13:51.295 --> 00:13:54.720 print(description). 236 00:13:54.720 --> 00:13:59.290 And if you run that and we enter in something like grape, 237 00:14:00.680 --> 00:14:01.700 we get the answer to that. 238 00:14:01.700 --> 00:14:06.170 If we enter another one like apple, And not in the amount 239 00:14:06.170 --> 00:14:10.322 that come up automatically quit out of it makes it like so, So, 240 00:14:10.322 --> 00:14:13.560 again is saw out of dictionary retrieves the value for 241 00:14:13.560 --> 00:14:17.400 specialized very similar to providing the key to square brackets but 242 00:14:17.400 --> 00:14:20.500 the great thing is it doesn't give an era if the key doesn't exist. 243 00:14:20.500 --> 00:14:23.790 So, instead it returns none as you saw when I just pressed enter there. 244 00:14:23.790 --> 00:14:25.980 And you can actually test for that if you wanted to. 245 00:14:25.980 --> 00:14:29.270 And you can actually confirm again If I typed in something like 246 00:14:30.830 --> 00:14:34.880 instead of just pressing enter we still get come up with none. 247 00:14:34.880 --> 00:14:39.700 Because it wasn't found for it to be typed on the it actually works just fine. 248 00:14:39.700 --> 00:14:42.140 So, actually taking it one step further before we finish this video. 249 00:14:43.650 --> 00:14:46.560 For the moment it's sharing a respective that it's trying print 250 00:14:46.560 --> 00:14:48.720 out the description, but what we can do here. 251 00:14:48.720 --> 00:14:51.820 We could do a test just after here before we 252 00:14:51.820 --> 00:14:55.150 set the description to see whether it exists in the dictionary. 253 00:14:55.150 --> 00:15:03.320 So we can type if dict underscore k in fruit, so using the in keyboard. 254 00:15:03.320 --> 00:15:05.700 Then and only then are we gonna set description. 255 00:15:05.700 --> 00:15:06.220 And print. 256 00:15:07.700 --> 00:15:10.390 Otherwise we'll put else, print. 257 00:15:12.520 --> 00:15:20.460 Don't have a dict_key, making sure you've got your indentation levels correct here, 258 00:15:20.460 --> 00:15:22.390 cuz obviously the code won't work without that. 259 00:15:22.390 --> 00:15:25.190 And of course I need to put a colon there to fix it up. 260 00:15:25.190 --> 00:15:29.420 So if I run that now and I just type something like apple. 261 00:15:30.450 --> 00:15:33.420 But if you type in something like tomato Tomato. 262 00:15:33.420 --> 00:15:34.880 We didn't have a tomato. 263 00:15:35.950 --> 00:15:38.200 Cucumber, we don't have cucumber. 264 00:15:38.200 --> 00:15:38.920 Enter. 265 00:15:38.920 --> 00:15:41.520 We don't have so I guess we could have tested for that. 266 00:15:41.520 --> 00:15:44.870 We could have made sure that did top, something it better but 267 00:15:44.870 --> 00:15:48.010 we haven't done that so consequently it's just printed out the empty string. 268 00:15:48.010 --> 00:15:50.480 If we put something like apple, which is valid. 269 00:15:50.480 --> 00:15:54.170 Apple, lemon, you can see it's printing those out quite nicely. 270 00:15:54.170 --> 00:15:56.290 We can type quit to exit out like so. 271 00:15:57.330 --> 00:15:59.680 So, I'm gonna end this video here now cuz it's getting a little bit long, 272 00:15:59.680 --> 00:16:00.570 as I mentioned. 273 00:16:00.570 --> 00:16:02.600 In the next video I'll continue exploring and 274 00:16:02.600 --> 00:16:05.140 going into more detail about Python Dictionaries.