WEBVTT 00:00.390 --> 00:03.630 They come back in this letter let us talk about dictionaries. 00:03.880 --> 00:07.320 So I hope by now you have an understanding of all dictionaries. 00:07.390 --> 00:12.060 It has a key and malapit musical room to separate them. 00:12.080 --> 00:14.780 Also it is open and closed with cannibalizes. 00:15.010 --> 00:17.390 Let me write a somber dictionary here. 00:22.630 --> 00:24.450 So that's my sample dictionary. 00:24.710 --> 00:26.690 Are we really need this classroom. 00:26.810 --> 00:34.250 And then I have to get my peers one whose name and which the values you want and the other one is is 00:34.460 --> 00:37.180 in which the value is 22. 00:37.190 --> 00:44.330 Now remember dishnet is like something a map or something in association with to use list and doubles 00:44.330 --> 00:46.490 and mean depending on sequence. 00:46.490 --> 00:47.970 So we have zero index. 00:47.990 --> 00:49.490 Then we have some value. 00:49.520 --> 00:50.590 We have one index. 00:50.630 --> 00:54.230 Then we have some value is in dictionaries. 00:54.230 --> 00:55.910 There is no 0 1 2 3. 00:55.930 --> 00:57.470 Next we have g. 00:57.500 --> 01:00.980 And then new pair that means this is its index name. 01:01.010 --> 01:02.870 And this is its value. 01:03.110 --> 01:09.280 If I talk about a simple list suppose a list we have a value of 20 30 and 40. 01:09.380 --> 01:11.520 So 0 and then 20. 01:11.540 --> 01:14.520 This is like a net Felician and the value. 01:14.570 --> 01:16.830 And similarly for dictionaries. 01:16.850 --> 01:23.470 So this is depend on theirs and it is really important when you work on transferring a bit. 01:23.570 --> 01:26.810 So now you have a key value that you do find yourself. 01:27.050 --> 01:31.580 So you can give it a name according to what content I am sending. 01:31.610 --> 01:38.450 So if I'm storing I mean I can give a name to my key that it's a name if I'm storing it I can give a 01:38.530 --> 01:38.920 name. 01:38.920 --> 01:40.980 The way I that it's page. 01:41.270 --> 01:42.880 So that's important. 01:42.980 --> 01:45.610 Now the second thing is the indexing is defined. 01:45.780 --> 01:54.030 So during the list all I could do is give my index politian in our Additionally I have to get the name. 01:54.190 --> 01:56.100 You can see I got my value. 01:56.350 --> 01:59.970 And also there is no sequence for the value that are storing. 01:59.980 --> 02:02.760 So if I try to exist is I cannot. 02:02.770 --> 02:04.490 Excellent an explanation. 02:04.600 --> 02:12.700 I have to pass it as Mekhi and you can see over the menu more we can store different data or deep inside. 02:12.700 --> 02:19.390 Additionally also in the previous example after I tried to store the value of Flude string and then 02:19.390 --> 02:24.490 list inside my top on same we can do with our dictionaries. 02:24.510 --> 02:27.930 So let me take you to the Sahad. 02:27.950 --> 02:32.590 I'm creating a new addition to the with the name of implied that is ENP. 02:32.780 --> 02:39.950 And then I'm passing a key as name in which I'm giving a value I Shavon sickness my age as twenty two. 02:39.980 --> 02:48.280 Now I'm taking third as smoke and I'm taking up a lot of false de-powered to store my hide in the edge 02:48.350 --> 02:48.830 in the blue. 02:48.890 --> 02:50.650 That is my height and weight. 02:50.660 --> 02:55.210 Now I'm passing double as my venue of six and seven day high. 02:55.340 --> 03:04.090 You can actually use different or die so you can see a string of Boullion after bones know what they've 03:04.090 --> 03:04.350 heard. 03:04.370 --> 03:06.340 I tried to access my complete list. 03:06.380 --> 03:07.880 It would be quite easy. 03:07.880 --> 03:14.030 The second thing is the second thing is if I want to AXS and even do all I have to pass is the key. 03:16.010 --> 03:20.510 So if I need to access my smoker I knew all I need to Basus smoke. 03:20.600 --> 03:25.710 You can see I got my Boullion than you want if I need to ox's this high in me. 03:25.900 --> 03:33.800 Ok that is true not on any two boxes the exact key off my top one you can see I got the response so 03:33.800 --> 03:39.960 you can play with additional He's also the next thing is if I try to access something that is not available 03:41.780 --> 03:44.860 maybe I bought something like soundly. 03:45.410 --> 03:50.790 So I got a keyword or maybe a are trying to parse the next value. 03:50.990 --> 03:54.470 I still got the key word answer because there is nothing like next. 03:54.500 --> 03:57.970 For our missionaries we have key values to handle that. 03:58.040 --> 04:04.550 The next thing I want to talk about is can we move on to our dictionary like double was immutable so 04:04.550 --> 04:12.600 we can not add list was Futebol so we can easily add yes similarly Niklaus dictionaries are also mutable. 04:12.740 --> 04:15.870 So do I add a new value on life to us. 04:15.970 --> 04:23.050 They can't very well and then open inclosing Square and all of the past is the key of our new element. 04:23.170 --> 04:32.280 So if I add Sandri and then I need to parse the value and if I do it says my dictionary no. 04:32.370 --> 04:38.910 You can see this is my last added value and then we can play with functions and methods that are given 04:38.910 --> 04:40.170 even if one is. 04:40.200 --> 04:42.150 So let me get some numbers. 04:42.240 --> 04:44.520 So the first one is Len. 04:44.550 --> 04:50.070 So by now I hope you already know everything about plan so if I bought my variable I got the number 04:50.070 --> 04:52.030 of elements that are available. 04:52.410 --> 04:59.880 The second one I want to talk about is good you can use this Kitman turned out to actually access a 04:59.870 --> 05:01.170 particular value of any. 05:01.160 --> 05:07.310 He said if my boss name you can say just be able to get this particular line to the next one you can 05:07.310 --> 05:08.640 talk about this. 05:08.680 --> 05:11.960 So Bob is usually used to remove any value. 05:12.280 --> 05:18.530 So if I do both and then possible sell you and tell me where to get it done on Sunday. 05:18.560 --> 05:24.720 But if I try to bring my dictionary now you can see the value is not available inside my dictionary. 05:24.830 --> 05:28.130 So that might work more if I need to clear them all. 05:28.130 --> 05:30.050 That means I want to empty my dictionary. 05:30.050 --> 05:38.850 I can use a clear function and then if I try to access my dictionary I got it intentionally. 05:39.140 --> 05:46.910 OK we can also use delete that is DL to remove this dictionary even if it has some value or even if 05:46.910 --> 05:55.330 it's and B they will really later on that uses B then parse the medieval name my friend tried to access. 05:55.330 --> 05:57.780 Additionally you'll see I got an error. 05:58.120 --> 06:00.710 So these are some important matters. 06:00.730 --> 06:05.380 And then there are some matters to access our value before accessing my elements. 06:05.380 --> 06:08.960 Let me create my dictionary again because I have deleted that. 06:09.190 --> 06:11.540 So I've created my dictionary again. 06:11.710 --> 06:19.530 And if I want to access only keys all I have to do is use my variable and then keys. 06:19.650 --> 06:25.140 I can also use vamoosed to get them to turn off all the values that are available in my dictionary. 06:28.020 --> 06:31.060 And then I want to access both key and many pairs. 06:31.080 --> 06:32.540 I can use items 06:35.130 --> 06:41.230 just look fine but I need to talk about one small thing we have talked about anything we have talked 06:41.230 --> 06:43.580 about deletion we have to. 06:43.840 --> 06:49.730 But what if I need to update any value for a particular key I can use don't they. 06:49.850 --> 06:53.590 All of that is part of any one name then abatement. 06:53.650 --> 06:56.200 And then I need to parse Mikey and Melamed 07:00.720 --> 07:07.180 and if I do X is my I've done something you can say I got my name. 07:07.340 --> 07:09.660 What if I try to or I do. 07:09.850 --> 07:14.130 It's not like I'm dead or I you out. 07:14.170 --> 07:17.890 All you have to do is use your variable and just try adding. 07:17.920 --> 07:20.400 Exactly like you are adding a new element. 07:20.530 --> 07:28.940 So when I will be adding it like a new element and if I do I do X is I don't know you can't it's not 07:29.030 --> 07:33.950 updating but it's actually already done on previous Elliman. 07:34.130 --> 07:36.090 I hope this lecture was helpful. 07:36.110 --> 07:42.750 Missionaries are very important to get in the door while you play with EPA when you work on verbs word. 07:42.830 --> 07:44.500 So they are really important. 07:44.900 --> 07:46.450 So see you in the next lecture.