So let us go for a new fight and let us create your or now again here.
So let us start by creating one variable first.
See, now this is we are creating a constant and giving it to value, also seeing the same format and
then say, S.H. are B and C, u m w.
This is the way we're storing the letters over here.
And you can also see that we are selling it as a frequency format CPV Vicki G.
X. Now these are the least used, hence keeping it in the last.
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
x y z.
So these are the normal letters in the format and these are we are storing it as the frequency letters
and then we will define the first method say get.
Letter can't function which to have a message estie as a parameter in it.
Now this function will return a dictionary with ease of single letter and the values of count of how
many times they appear in the message parameter.
So here we are taking the letter count as dear, and that's equal to we are storing it in this first
c e colon.
C zero.
Similarly, B zero.
Initially all the letters we are giving that they appear zero zero zero F, then G.
Then H.
I
g- let's move on to the next line C, OK?
Then El.
And.
We'll show you then secu.
They say, oh, as.
Dean, Dean.
OK, you have given him no, I guess.
OK, OK, so after I've given a comma here.
So let's continue.
We.
W, X, Y, and finally, the last one, that's OK now after we have defined this little count as we
are, we've run a for loop, seeing for, say, Lettow Estie are in the message estie are thought to
appear in this.
We will check every little letter of in your little S.G. are in this and we will see later found S.T.
are at the index of Little Hestia plus is equal to one incremented by one.
And finally here we would see little letup count stf.
That is the end of your definition for the function, that little function.
Then we define another function, that is get the item at index zero function and here we pass item
STF as the parameter.
Here we just have a written statement saying the atmosphere at the index zettl.
Then the next function we have is the frequency of the function, which again takes up the message is
the parameter.
And in this we will return a string of the alphabet letters arranged in order of most frequently occurring
in the message parameter.
So first we will get a dictionary of these of each letter and its frequency controls.
So the first thing we will do this letter to.
Frequency still that's equal to we will get the.
Little found function and positive, the value that this message is still after, which, after we get
this second, we will make a dictionary of each frequency count to the letter with that frequency.
So here we are making frequency two letters, dear, and that's equal to initially blank.
We a for saying letters are in your letter Asgeir then Visnjic.
If the letter to frequency is still at the index of letter, Asgeir is not in your frequency to letters.
Then you will see frequency two letters at the index instead of the index of little low frequency Estima
and the index of.
Literacy is equal to index letter Esteve else we will make here the frequency to literacy are the index
of local to frequency Asgeir
Literacy Year thought we are spending in it and that is literacy now after this.
Now, the third thing is we would put each list of those individuals, although that is we are having
to lie in order and then we will convert it to spring.
So after this, we will go back to the form of and create yet another for loops for frequency one in
your frequency to later this year.
We are opening the for loop here and seeing frequency to later this year at the index of frequency one
dot.
We are sorting it and the key we are giving for sorting is C, e, d, e or I.
N, the variable that we have got find and seeing the reverse is equal to.
Then in the same for loop, we continue seeing frequency to let Oresteia add the index of frequency
one is equal to blank, join the value of frequency to let Oresteia and the index of frequency.
Now once we have done this, the next or the fourth thing that we will do is convert frequency to letter
SDR dictionary to a list of pupil pairs which will have given value and then we would sort that.