1 00:00:00,000 --> 00:00:02,600 [no audio] 2 00:00:02,600 --> 00:00:05,900 In this video we are going to discuss about dictionary data 3 00:00:05,900 --> 00:00:08,400 structure of Python, right? 4 00:00:08,600 --> 00:00:12,900 Let me open my editor. So here 5 00:00:12,900 --> 00:00:16,900 I am going to define a dictionary called, so dictionaries are 6 00:00:16,900 --> 00:00:18,600 represented with curly braces, 7 00:00:19,800 --> 00:00:27,900 right. And then let's say 'print(my_dict)', and then I am 8 00:00:27,900 --> 00:00:31,300 also printing type of your given variable structure. 9 00:00:32,100 --> 00:00:34,000 So you're going to see output is a dictionary, that means 10 00:00:34,000 --> 00:00:35,500 whatever you define with curly braces 11 00:00:35,500 --> 00:00:37,200 that is a dictionary. That's fine. 12 00:00:38,400 --> 00:00:39,400 Next thing. 13 00:00:40,300 --> 00:00:43,900 Let me convert that into Boolean. You know it is a empty 14 00:00:44,000 --> 00:00:46,900 dictionary, right? I am converting that into Boolean. 15 00:00:47,400 --> 00:00:51,700 So, you know any empty, if you convert that into Boolean it 16 00:00:51,700 --> 00:00:53,900 is always 'False'. That's what we are getting here. Already 17 00:00:53,900 --> 00:00:55,300 we know this rule as well, right. 18 00:00:56,400 --> 00:01:01,400 Now what I am doing is, I'm going to comment this. Now I am 19 00:01:01,400 --> 00:01:05,800 going to define a dictionary with some data. 20 00:01:06,200 --> 00:01:08,600 So guys whenever if you want to write a dictionary with some 21 00:01:08,600 --> 00:01:12,000 data, you have to write like a key and its value pair. 22 00:01:12,400 --> 00:01:18,600 I mean, let's say I am going to write this as key and this as value, 23 00:01:18,600 --> 00:01:22,400 [no audio] 24 00:01:22,400 --> 00:01:23,400 anything, 25 00:01:24,600 --> 00:01:27,100 this is a key and value is suppose 26 00:01:27,100 --> 00:01:31,300 let's say, or I can take, and one more thing guys, whenever if 27 00:01:31,300 --> 00:01:34,600 you are writing either key or value, if that is a string you 28 00:01:34,600 --> 00:01:36,300 have to write in quotations. 29 00:01:36,700 --> 00:01:39,900 Don't forget that. Now suppose 30 00:01:39,900 --> 00:01:42,900 I am feeling that 1 is my key, but I want to take that as 31 00:01:42,900 --> 00:01:47,200 a number, then I can write 1 directly and its value. 32 00:01:48,000 --> 00:01:51,700 Let's say 2 is a key, and its value is number 2. 33 00:01:51,900 --> 00:01:53,800 Yes, all are valid ones. 34 00:01:54,500 --> 00:01:57,600 So, but the thing is whenever if you are define your dictionary, 35 00:01:57,600 --> 00:02:00,900 it should be like a key and its value pair representation. 36 00:02:01,300 --> 00:02:04,500 That means, so this is one item actually. In this item 37 00:02:04,500 --> 00:02:06,200 this is a key and it is a value. 38 00:02:06,600 --> 00:02:09,400 So this is a key-value pair representation, same way key and 39 00:02:09,400 --> 00:02:13,199 its value, so key-value pair representation. Key and value, 40 00:02:13,199 --> 00:02:17,300 key-pair representation. Key and its value, key-value pair representation. 41 00:02:17,300 --> 00:02:19,200 [no audio] 42 00:02:19,200 --> 00:02:25,200 Right. Fine. Now how you can access, how you 43 00:02:25,200 --> 00:02:28,800 can access the value from your dictionary? 44 00:02:29,600 --> 00:02:32,900 So actually values are, if you observe, this is a value, 45 00:02:33,100 --> 00:02:34,400 this is a value, this is a value, 46 00:02:34,400 --> 00:02:36,400 this is a value, and this is a key, 47 00:02:36,600 --> 00:02:37,600 this is a key, 48 00:02:38,800 --> 00:02:39,800 this is a key, 49 00:02:40,000 --> 00:02:44,300 this is also key. So all these are keys and all these are values. 50 00:02:45,800 --> 00:02:50,000 Right, so if you want to access any value from your dictionary it 51 00:02:50,000 --> 00:02:52,500 is always possible with your key only. 52 00:02:53,300 --> 00:02:56,100 Let me print that, 'my_dict.' 53 00:02:56,600 --> 00:02:57,600 Let me do this. 54 00:02:58,800 --> 00:03:02,200 "fruit", there is a key inside of your dictionary "fruit". 55 00:03:02,200 --> 00:03:04,900 Now, I want to print the value for that "fruit" key. 56 00:03:05,300 --> 00:03:10,900 Yes Apple you are getting Right, so you can also use one 57 00:03:10,900 --> 00:03:11,800 more syntax. 58 00:03:11,800 --> 00:03:14,800 That is called my dictionary dot get let's say I'm going 59 00:03:14,800 --> 00:03:15,900 to take animal. 60 00:03:16,300 --> 00:03:18,400 Of course, you can take anything now see the output what 61 00:03:18,400 --> 00:03:24,500 you are getting is you are getting now Let me come and all 62 00:03:24,500 --> 00:03:25,200 these things. 63 00:03:28,800 --> 00:03:31,100 I am going to print my dictionary. 64 00:03:36,900 --> 00:03:39,600 Something like dictionary called I mean key called. 65 00:03:40,400 --> 00:03:42,100 Let's say three. 66 00:03:42,900 --> 00:03:44,000 Do you have three key? 67 00:03:44,000 --> 00:03:44,700 No dictionary. 68 00:03:44,700 --> 00:03:49,400 No, but if I try to access in this way see the output it 69 00:03:49,400 --> 00:03:53,800 is giving an error key error three key 3 it is not there. 70 00:03:53,800 --> 00:03:55,200 Actually, that's why you're getting this error. 71 00:03:55,900 --> 00:04:01,000 But instead of this syntax if I follow print might dictionary 72 00:04:01,000 --> 00:04:03,900 dot get Three. 73 00:04:04,400 --> 00:04:06,500 I don't know whether three is there or not but I am trying 74 00:04:06,500 --> 00:04:09,700 to get in this way see the difference between previous syntax 75 00:04:09,700 --> 00:04:14,200 and this syntax the syntax is giving now in giving none instead 76 00:04:14,200 --> 00:04:15,300 of giving an error. 77 00:04:15,300 --> 00:04:18,899 That's why this is the best one to get any time you are key. 78 00:04:20,800 --> 00:04:23,500 But if you want to rise an error or the time you can go and 79 00:04:23,500 --> 00:04:24,200 take this one. 80 00:04:25,600 --> 00:04:26,000 Right. 81 00:04:26,200 --> 00:04:29,700 So both the ways are used to access your values based on 82 00:04:29,700 --> 00:04:34,300 keys. Now, let me print your dictionary first. 83 00:04:40,700 --> 00:04:43,300 So guys if you want to see how many operations are and what 84 00:04:43,300 --> 00:04:45,500 are the different operations are there with your dictionary. 85 00:04:45,700 --> 00:04:46,800 We have a shortcut. 86 00:04:47,000 --> 00:04:49,000 Let's define some dictionary. 87 00:04:50,200 --> 00:04:57,100 and CDR of x These all are the operations so already we have 88 00:04:57,100 --> 00:04:59,700 seen get operation right now. 89 00:04:59,700 --> 00:05:00,800 Let me do one thing. 90 00:05:02,100 --> 00:05:06,000 My dictionary dot clear and after this operation I am trying 91 00:05:06,000 --> 00:05:09,000 to print my dictionary so before and after that operation, 92 00:05:09,000 --> 00:05:11,000 I am printing see clear simply. 93 00:05:11,000 --> 00:05:14,700 It is removing all key value pair representation from your 94 00:05:14,700 --> 00:05:16,300 dictionary. That's it. 95 00:05:20,700 --> 00:05:22,200 And that is okay. 96 00:05:23,600 --> 00:05:26,700 Yeah, actually you are accessing a value based on keys right. 97 00:05:26,900 --> 00:05:27,100 Now. 98 00:05:27,100 --> 00:05:34,100 What I am doing is I want to assign a new key value pair 99 00:05:34,100 --> 00:05:38,400 representation. I want to add a new key value pair representation 100 00:05:38,400 --> 00:05:39,300 for my dictionary. 101 00:05:41,700 --> 00:05:42,100 Right. 102 00:05:42,600 --> 00:05:47,900 Let's say I want to take key as 3 right and its value as 103 00:05:47,900 --> 00:05:52,200 something like that three now after this just observe your 104 00:05:52,200 --> 00:05:56,000 dictionary. Now you're getting this one. 105 00:05:56,000 --> 00:05:56,200 No. 106 00:05:57,600 --> 00:06:00,000 Three key value 3. 107 00:06:00,600 --> 00:06:04,300 So this is the key value pair representation and you are 108 00:06:04,300 --> 00:06:07,500 adding with the help of this syntax or simply this is the 109 00:06:07,500 --> 00:06:12,500 way to add a new value based on key or dictionary but while 110 00:06:12,500 --> 00:06:18,000 doing in this way by mistake you are taking now I am taking 111 00:06:18,200 --> 00:06:21,000 three, but I don't know whether key is there on my dictionary 112 00:06:21,000 --> 00:06:23,300 or not, but I am trying to do in this way. 113 00:06:26,200 --> 00:06:29,900 Not see the output first instead of number three, you're 114 00:06:29,900 --> 00:06:30,900 getting 56. 115 00:06:30,900 --> 00:06:38,000 The reason is while assigning a key value based on key in 116 00:06:38,000 --> 00:06:41,700 this way if key already there then value will be update. 117 00:06:42,800 --> 00:06:45,800 If that key is not present in a given directory, then new 118 00:06:45,800 --> 00:06:48,200 key value pair representation will be created. 119 00:06:48,400 --> 00:06:48,900 That's it. 120 00:06:49,600 --> 00:06:52,000 See before executing 16th step. 121 00:06:52,000 --> 00:06:55,100 You know, there is no key value pair called three and number 122 00:06:55,100 --> 00:06:59,000 three. That's why because of 16th line you are able to add 123 00:06:59,000 --> 00:07:00,000 and in 17th line. 124 00:07:00,000 --> 00:07:03,300 We are seeing that new key value pair representation is added 125 00:07:03,300 --> 00:07:04,100 to your dictionary. 126 00:07:05,400 --> 00:07:05,900 Now. 127 00:07:07,100 --> 00:07:11,200 What I am doing is I am trying to modify my existing key 128 00:07:11,700 --> 00:07:15,600 value. So while doing in this way if key is not there it 129 00:07:15,600 --> 00:07:18,200 will do it will give a new key value pair representation. 130 00:07:18,200 --> 00:07:22,100 If already key is there the old value will be modified. 131 00:07:22,200 --> 00:07:27,700 So be careful while doing while assigning a value to your 132 00:07:27,700 --> 00:07:35,500 key. right fine now, let me comment all these things. 133 00:07:39,300 --> 00:07:42,200 So this is your dictionary or getting now what I am doing 134 00:07:42,200 --> 00:07:44,600 is print my dictionary. 135 00:07:47,100 --> 00:07:48,700 Dot Keys. 136 00:07:48,700 --> 00:07:53,700 Case it will give a list of keys dictionary Keys you are 137 00:07:53,700 --> 00:07:54,200 getting know. 138 00:07:57,100 --> 00:07:59,200 Same way you have one more operation called. 139 00:08:01,200 --> 00:08:01,500 . 140 00:08:01,500 --> 00:08:03,900 Values see the output what you are getting. 141 00:08:05,000 --> 00:08:08,600 You're getting only values right now. 142 00:08:08,600 --> 00:08:10,700 You have something called items operation. 143 00:08:10,800 --> 00:08:11,900 Let me take that. 144 00:08:16,600 --> 00:08:22,200 Print your dictionary dot items see the output what you are 145 00:08:22,200 --> 00:08:28,400 getting you are getting a key and value as one item see that. 146 00:08:33,500 --> 00:08:37,500 right, so then already we have seen. 147 00:08:38,700 --> 00:08:44,299 Yeah, copy will see first copy then yeah see nothing is there. 148 00:08:46,000 --> 00:08:49,900 Y equals to my dictionary dot copy. 149 00:08:50,799 --> 00:08:53,000 That's it then print why? 150 00:08:57,100 --> 00:08:59,900 Right and you know, what is the purpose of copyright? 151 00:09:00,000 --> 00:09:05,800 Let me print your ID of Y and then idea of my dictionary 152 00:09:06,800 --> 00:09:07,600 see the output. 153 00:09:09,600 --> 00:09:12,900 So IDs are different means whenever if you do copy write 154 00:09:13,200 --> 00:09:15,800 a new memory location will be assigned to your variable y 155 00:09:15,900 --> 00:09:19,400 but directly if you assign y equals to my dictionary the 156 00:09:19,400 --> 00:09:24,600 same memory address will be referenced even for y also only 157 00:09:24,600 --> 00:09:26,900 we discuss this while working with your list, right? 158 00:09:27,300 --> 00:09:30,000 So I assume this is a dictionary and this is my dictionary 159 00:09:30,200 --> 00:09:33,700 a variable called my dictionary and someone memory address 160 00:09:33,700 --> 00:09:36,500 is there and this is representing with your my dictionary 161 00:09:36,800 --> 00:09:39,300 if I straightforward if I do y equals to minus. 162 00:09:39,400 --> 00:09:42,500 Dictionary what will happen why is also going to reference 163 00:09:42,500 --> 00:09:47,400 reference same memory address, but I don't want to do in 164 00:09:47,400 --> 00:09:49,900 that I want to create a new memory location and I want to 165 00:09:49,900 --> 00:09:53,400 copy this data to here and I want to assign this memory location 166 00:09:53,400 --> 00:09:57,400 to Y then at that time you have to do use dot copy operation. 167 00:09:58,600 --> 00:09:59,100 That's it. 168 00:10:01,200 --> 00:10:03,700 Okay, so fine. 169 00:10:04,900 --> 00:10:07,900 Now, let me comment all these lines once again. 170 00:10:13,300 --> 00:10:15,300 Then what is the next operation? 171 00:10:16,900 --> 00:10:19,100 Get is done, right? 172 00:10:20,000 --> 00:10:20,200 Yeah. 173 00:10:20,200 --> 00:10:24,400 We'll go with form Keys cleared and copy done get items done 174 00:10:24,400 --> 00:10:25,100 Keys done. 175 00:10:26,700 --> 00:10:28,200 I will go with the first. 176 00:10:30,400 --> 00:10:32,100 Pop and pop item. 177 00:10:32,100 --> 00:10:35,400 I will go with update update is nothing. 178 00:10:35,400 --> 00:10:38,600 But if you have already some dictionary, right, let's say 179 00:10:39,200 --> 00:10:42,200 you have this dictionary and I'm having one more dictionary 180 00:10:42,200 --> 00:10:43,600 called new dictionary. 181 00:10:44,800 --> 00:10:52,800 equals to something called for Value for of course. 182 00:10:52,800 --> 00:10:55,400 You can take number four also string no problem, right? 183 00:10:56,600 --> 00:10:58,700 Now what I want to do is this key value pair. 184 00:10:58,700 --> 00:11:01,100 I want to add into my old dictionary. 185 00:11:01,200 --> 00:11:06,600 Then you have to do your old dictionary dot update with your 186 00:11:06,600 --> 00:11:07,300 new dictionary. 187 00:11:08,100 --> 00:11:08,700 That's it. 188 00:11:08,900 --> 00:11:11,900 So after this just try to print your dictionary and see the 189 00:11:11,900 --> 00:11:17,400 result. Right new key value pair added to your old dictionary. 190 00:11:17,400 --> 00:11:19,000 So update is for that purpose. 191 00:11:19,000 --> 00:11:22,700 If you want to add one dictionary to other dictionary, then 192 00:11:22,700 --> 00:11:25,700 you have to use update operation on your dictionaries your 193 00:11:25,700 --> 00:11:28,600 old dictionary dot update then what is the data? 194 00:11:28,600 --> 00:11:29,900 You want to update your voltage? 195 00:11:29,900 --> 00:11:31,100 Sorry that dictionary. 196 00:11:32,600 --> 00:11:34,900 Fine then. 197 00:11:34,900 --> 00:11:37,000 Let me go with pop. 198 00:11:38,800 --> 00:11:46,300 see Okay, so guys as of now, what is your latest dictionary 199 00:11:46,300 --> 00:11:49,000 suppose, this is your latest dictionary right? 200 00:11:49,000 --> 00:11:51,700 Let me come and do some where you are print statement. 201 00:11:54,100 --> 00:11:55,600 Now see your latest dictionary. 202 00:11:55,600 --> 00:11:58,200 Is there something like this right. 203 00:11:58,900 --> 00:11:59,100 Now? 204 00:11:59,100 --> 00:12:03,900 What I am doing is I am doing simply dictionary dot pop operation. 205 00:12:06,100 --> 00:12:08,700 And after that I am trying to print what is my dictionary? 206 00:12:09,900 --> 00:12:12,800 See the output something wrong. 207 00:12:17,300 --> 00:12:17,800 Oh, sorry. 208 00:12:17,800 --> 00:12:19,300 I didn't provide a key, right? 209 00:12:20,000 --> 00:12:21,700 Yeah, I have to provide a key. 210 00:12:23,300 --> 00:12:25,400 Let's say key called for. 211 00:12:28,500 --> 00:12:34,300 See that pop is used to remove a key value pair representation 212 00:12:34,500 --> 00:12:35,600 based on key. 213 00:12:35,800 --> 00:12:38,800 We are giving only key it is removing your key value pair 214 00:12:38,800 --> 00:12:40,900 representation from your dictionary. 215 00:12:42,000 --> 00:12:44,600 There is one more thing called pop item. 216 00:12:46,900 --> 00:12:47,400 Right. 217 00:12:47,700 --> 00:12:53,500 Let me run this thing and see the output my dictionary dot 218 00:12:54,400 --> 00:12:55,500 pop item. 219 00:12:56,700 --> 00:12:59,100 And after that I am trying to print my dick, sorry. 220 00:13:00,900 --> 00:13:02,200 See the output what you are getting. 221 00:13:04,300 --> 00:13:04,700 Right. 222 00:13:04,800 --> 00:13:08,600 It is removing some dick key value pair representation. 223 00:13:08,600 --> 00:13:11,900 Actually, it will remove randomly maybe lost value somewhere 224 00:13:11,900 --> 00:13:16,600 middle or something, whatever it may be right and you can 225 00:13:16,600 --> 00:13:19,600 assign this item what you are removing. 226 00:13:19,600 --> 00:13:23,100 So remove removed item. 227 00:13:24,800 --> 00:13:27,600 And finally print what you are removing with the help of 228 00:13:27,900 --> 00:13:29,100 your pop item. 229 00:13:30,500 --> 00:13:31,400 You can see that. 230 00:13:32,400 --> 00:13:35,900 See, this is what you are removing with the help of Pop item. 231 00:13:36,100 --> 00:13:36,500 So Pop. 232 00:13:36,500 --> 00:13:38,100 I do actually removes randomly. 233 00:13:39,400 --> 00:13:39,900 That's it. 234 00:13:42,100 --> 00:13:42,500 Okay. 235 00:13:43,100 --> 00:13:45,000 Now we done for by item. 236 00:13:45,100 --> 00:13:48,400 Then we have form keys and set default. 237 00:13:48,500 --> 00:13:51,600 Let me go with the from keys. 238 00:13:52,900 --> 00:13:54,200 Okay, so nothing. 239 00:13:54,200 --> 00:13:57,700 Is there guys let me come and all those things. 240 00:14:05,100 --> 00:14:07,300 Let's say a house some keys called. 241 00:14:12,400 --> 00:14:19,300 I owe you right. 242 00:14:19,300 --> 00:14:22,100 I am taking as a list of case list of case. 243 00:14:23,800 --> 00:14:24,000 Okay. 244 00:14:24,000 --> 00:14:27,400 Now I want to create a dictionary which consists of this 245 00:14:27,400 --> 00:14:34,200 case right see new dictionary equals to dictionary Dot from 246 00:14:34,200 --> 00:14:37,100 Keys. Just give your keys. 247 00:14:38,000 --> 00:14:42,000 Now it is going to create a new dictionary with keys as a 248 00:14:42,000 --> 00:14:44,500 I do You observe the output and values are known because 249 00:14:44,500 --> 00:14:46,800 we as of now, I don't have any values now you can update 250 00:14:47,000 --> 00:14:49,500 whatever the key value if you want to update you can update. 251 00:14:49,500 --> 00:14:53,900 Let's say I want to update new dictionary with the key called. 252 00:14:53,900 --> 00:14:54,400 Yay. 253 00:14:54,500 --> 00:14:59,400 I want to assign letter first letter first alphabet. 254 00:15:03,600 --> 00:15:04,400 Something like that. 255 00:15:05,200 --> 00:15:07,500 So after that you just print and see your dictionary. 256 00:15:08,400 --> 00:15:12,800 So nothing is there guys from keys are used to create a dictionary 257 00:15:13,600 --> 00:15:19,400 create a dictionary with Required Keys that's it. 258 00:15:21,900 --> 00:15:25,800 Right fine now, let me go with last one. 259 00:15:30,100 --> 00:15:31,800 That is set to default. 260 00:15:33,300 --> 00:15:33,600 Nothing. 261 00:15:33,600 --> 00:15:38,200 Is there guys as of now, let me take some dictionary called 262 00:15:38,200 --> 00:15:39,100 empty dictionary. 263 00:15:40,900 --> 00:15:41,400 Right. 264 00:15:43,000 --> 00:15:49,900 Now what I am doing is I am trying to look for some key if 265 00:15:49,900 --> 00:15:50,800 that key is there. 266 00:15:50,800 --> 00:15:54,100 Okay, and if whatever the value I'm having in that I will 267 00:15:54,100 --> 00:15:56,400 use that if that key is not there. 268 00:15:59,700 --> 00:16:00,600 See suppose. 269 00:16:01,200 --> 00:16:02,200 I don't know whether keys. 270 00:16:02,200 --> 00:16:05,200 There are not if key is their use that value itself. 271 00:16:05,200 --> 00:16:07,900 If it is not there update with the new value. 272 00:16:08,000 --> 00:16:12,500 I mean first Observer this output then you can understand. 273 00:16:13,900 --> 00:16:15,000 So set default. 274 00:16:15,000 --> 00:16:17,700 I am setting for number K value 45. 275 00:16:17,800 --> 00:16:23,200 Sorry for key K value 45 now after this, let me create a 276 00:16:23,200 --> 00:16:24,400 dictionary with. 277 00:16:27,000 --> 00:16:32,300 any any Okay. 278 00:16:33,000 --> 00:16:35,800 Now what I am doing is again, I am running my dictionary 279 00:16:35,800 --> 00:16:42,900 dot set default if already key is there then it won't disturb 280 00:16:43,000 --> 00:16:47,300 if key is not there then it will update with suppose. 281 00:16:50,400 --> 00:16:56,300 A new value now see the output now it won't modify your valuable 282 00:16:56,300 --> 00:16:58,500 because already fruit is their fruit key. 283 00:16:58,500 --> 00:17:01,600 Is there no dictionary with a value called Apple now the 284 00:17:01,600 --> 00:17:05,800 purpose of set default is if this key is already not there 285 00:17:06,098 --> 00:17:08,700 if it is not there in your dictionary then only it will take 286 00:17:08,700 --> 00:17:09,598 a default value. 287 00:17:09,900 --> 00:17:10,900 If it is already there. 288 00:17:10,900 --> 00:17:13,598 Whatever the value is there that will only it will consider 289 00:17:14,098 --> 00:17:17,700 just nothing but you know, you're trying to add a new key. 290 00:17:18,000 --> 00:17:19,500 You don't know whether key is there or not? 291 00:17:20,300 --> 00:17:23,400 If key is there don't disturb if key is not there then set 292 00:17:23,400 --> 00:17:24,800 this value for that key. 293 00:17:25,200 --> 00:17:25,700 That's it. 294 00:17:26,400 --> 00:17:28,500 So that is the use of set default. 295 00:17:28,700 --> 00:17:29,099 Okay. 296 00:17:29,900 --> 00:17:33,900 So Guys, these are the operations on your dictionaries. 297 00:17:34,400 --> 00:17:37,000 The final important point is guys previously. 298 00:17:37,000 --> 00:17:40,599 The dictionary is an ordered collection of dictionary. 299 00:17:41,000 --> 00:17:46,000 I mean before 3.7 version now in 3.7 version dictionary is 300 00:17:46,000 --> 00:17:47,400 ordered collection. 301 00:17:47,400 --> 00:17:49,800 That means the way how you are defining. 302 00:17:50,200 --> 00:17:51,500 Same order you will get it. 303 00:17:53,500 --> 00:17:54,800 Right see suppose. 304 00:17:54,800 --> 00:17:55,800 Let's say this is your dick. 305 00:17:55,800 --> 00:17:56,100 Sorry. 306 00:17:59,200 --> 00:18:00,600 Let me go with your command line. 307 00:18:05,800 --> 00:18:07,700 Let me copy that and paste it. 308 00:18:08,900 --> 00:18:11,400 So if you print your dictionary you are getting in the same 309 00:18:11,400 --> 00:18:12,800 order the way how you define. 310 00:18:13,400 --> 00:18:15,100 Let me go with my python 2. 311 00:18:17,500 --> 00:18:24,800 so my python 2, is there somewhere python 2 And let me Define 312 00:18:24,800 --> 00:18:26,000 my dictionary here. 313 00:18:27,800 --> 00:18:29,300 And let me print your dictionary. 314 00:18:32,500 --> 00:18:34,500 See order has been changed. 315 00:18:34,500 --> 00:18:39,600 No, actually we have started starting Keys fruit, but you 316 00:18:39,600 --> 00:18:45,000 are getting an output 1 so in previous versions before 3.7 317 00:18:45,900 --> 00:18:50,900 Your Dictionary was unordered collection of data, but in 318 00:18:50,900 --> 00:18:55,200 3.7 you are dictionaries ordered data. 319 00:18:56,500 --> 00:18:58,200 Okay ordered collection of data. 320 00:18:58,200 --> 00:18:59,600 You have to remember this point. 321 00:19:01,600 --> 00:19:03,800 Okay guys, thank you for watching this video.