1 00:00:00,360 --> 00:00:07,200 So let us go for a new fight and let us create your or now again here. 2 00:00:07,440 --> 00:00:11,760 So let us start by creating one variable first. 3 00:00:12,400 --> 00:00:20,630 See, now this is we are creating a constant and giving it to value, also seeing the same format and 4 00:00:21,450 --> 00:00:28,300 then say, S.H. are B and C, u m w. 5 00:00:28,500 --> 00:00:32,280 This is the way we're storing the letters over here. 6 00:00:33,990 --> 00:00:41,340 And you can also see that we are selling it as a frequency format CPV Vicki G. 7 00:00:41,340 --> 00:00:45,960 X. Now these are the least used, hence keeping it in the last. 8 00:00:46,380 --> 00:00:58,470 Then we are having a little R which is having all the letters b c d e f g h i j k l m p q mr youve w 9 00:00:58,470 --> 00:00:59,800 x y z. 10 00:01:00,270 --> 00:01:05,880 So these are the normal letters in the format and these are we are storing it as the frequency letters 11 00:01:06,240 --> 00:01:09,900 and then we will define the first method say get. 12 00:01:12,100 --> 00:01:21,730 Letter can't function which to have a message estie as a parameter in it. 13 00:01:22,120 --> 00:01:28,330 Now this function will return a dictionary with ease of single letter and the values of count of how 14 00:01:28,330 --> 00:01:31,060 many times they appear in the message parameter. 15 00:01:31,360 --> 00:01:40,150 So here we are taking the letter count as dear, and that's equal to we are storing it in this first 16 00:01:40,150 --> 00:01:42,300 c e colon. 17 00:01:42,670 --> 00:01:43,430 C zero. 18 00:01:43,990 --> 00:01:47,110 Similarly, B zero. 19 00:01:47,440 --> 00:02:01,600 Initially all the letters we are giving that they appear zero zero zero F, then G. 20 00:02:03,190 --> 00:02:04,330 Then H. 21 00:02:07,090 --> 00:02:07,570 I 22 00:02:10,930 --> 00:02:17,220 g- let's move on to the next line C, OK? 23 00:02:21,120 --> 00:02:23,400 Then El. 24 00:02:30,230 --> 00:02:30,610 And. 25 00:02:37,310 --> 00:02:42,080 We'll show you then secu. 26 00:02:44,640 --> 00:02:49,560 They say, oh, as. 27 00:02:52,600 --> 00:02:55,680 Dean, Dean. 28 00:02:57,340 --> 00:03:00,670 OK, you have given him no, I guess. 29 00:03:01,440 --> 00:03:07,010 OK, OK, so after I've given a comma here. 30 00:03:07,010 --> 00:03:08,700 So let's continue. 31 00:03:10,310 --> 00:03:10,700 We. 32 00:03:13,210 --> 00:03:28,550 W, X, Y, and finally, the last one, that's OK now after we have defined this little count as we 33 00:03:28,570 --> 00:03:40,150 are, we've run a for loop, seeing for, say, Lettow Estie are in the message estie are thought to 34 00:03:40,150 --> 00:03:41,860 appear in this. 35 00:03:41,890 --> 00:03:53,740 We will check every little letter of in your little S.G. are in this and we will see later found S.T. 36 00:03:53,740 --> 00:04:00,790 are at the index of Little Hestia plus is equal to one incremented by one. 37 00:04:01,060 --> 00:04:08,170 And finally here we would see little letup count stf. 38 00:04:08,740 --> 00:04:12,750 That is the end of your definition for the function, that little function. 39 00:04:13,180 --> 00:04:25,840 Then we define another function, that is get the item at index zero function and here we pass item 40 00:04:25,840 --> 00:04:28,600 STF as the parameter. 41 00:04:28,900 --> 00:04:38,530 Here we just have a written statement saying the atmosphere at the index zettl. 42 00:04:39,280 --> 00:04:49,870 Then the next function we have is the frequency of the function, which again takes up the message is 43 00:04:49,880 --> 00:04:51,270 the parameter. 44 00:04:51,640 --> 00:04:58,450 And in this we will return a string of the alphabet letters arranged in order of most frequently occurring 45 00:04:58,450 --> 00:04:59,720 in the message parameter. 46 00:05:00,100 --> 00:05:05,470 So first we will get a dictionary of these of each letter and its frequency controls. 47 00:05:06,110 --> 00:05:09,640 So the first thing we will do this letter to. 48 00:05:11,840 --> 00:05:16,070 Frequency still that's equal to we will get the. 49 00:05:17,730 --> 00:05:27,840 Little found function and positive, the value that this message is still after, which, after we get 50 00:05:27,840 --> 00:05:33,750 this second, we will make a dictionary of each frequency count to the letter with that frequency. 51 00:05:34,110 --> 00:05:41,750 So here we are making frequency two letters, dear, and that's equal to initially blank. 52 00:05:42,150 --> 00:05:50,010 We a for saying letters are in your letter Asgeir then Visnjic. 53 00:05:50,010 --> 00:06:05,870 If the letter to frequency is still at the index of letter, Asgeir is not in your frequency to letters. 54 00:06:06,780 --> 00:06:21,000 Then you will see frequency two letters at the index instead of the index of little low frequency Estima 55 00:06:21,390 --> 00:06:22,740 and the index of. 56 00:06:24,190 --> 00:06:40,870 Literacy is equal to index letter Esteve else we will make here the frequency to literacy are the index 57 00:06:40,870 --> 00:06:45,820 of local to frequency Asgeir 58 00:06:48,850 --> 00:06:57,760 Literacy Year thought we are spending in it and that is literacy now after this. 59 00:06:58,480 --> 00:07:05,960 Now, the third thing is we would put each list of those individuals, although that is we are having 60 00:07:06,040 --> 00:07:09,890 to lie in order and then we will convert it to spring. 61 00:07:10,360 --> 00:07:20,050 So after this, we will go back to the form of and create yet another for loops for frequency one in 62 00:07:20,260 --> 00:07:24,810 your frequency to later this year. 63 00:07:25,660 --> 00:07:34,570 We are opening the for loop here and seeing frequency to later this year at the index of frequency one 64 00:07:34,570 --> 00:07:34,960 dot. 65 00:07:35,110 --> 00:07:41,980 We are sorting it and the key we are giving for sorting is C, e, d, e or I. 66 00:07:41,980 --> 00:07:50,680 N, the variable that we have got find and seeing the reverse is equal to. 67 00:07:52,180 --> 00:08:01,600 Then in the same for loop, we continue seeing frequency to let Oresteia add the index of frequency 68 00:08:01,600 --> 00:08:13,110 one is equal to blank, join the value of frequency to let Oresteia and the index of frequency. 69 00:08:14,350 --> 00:08:21,530 Now once we have done this, the next or the fourth thing that we will do is convert frequency to letter 70 00:08:21,590 --> 00:08:27,980 SDR dictionary to a list of pupil pairs which will have given value and then we would sort that.