Now we come to the reversing the letter laced with the sword.
Now the sword they let those individuals on, do we also need to support them based on the own strength
by assigning them not find the key after the matter has been called on all the letters so that they
are all indexers?
The sword metal source, the letter based on the numerical index.
Now usually this function, swords, whatever list it's called on in the alphabetical or numerical order,
which is known as ascending order, not the soft items in the descending order, which is in reverse
alphabetical or reverse numerical order we pass through for this assortment also reveals document.
Hence, if we go back to our program here, we are passing divorcées through, after which we are seeing
frequency to Orestiada.
The index of frequency one is equal to.
We are using the joint with frequency to let the discharge frequency one.
Then we recall that at this point the frequency to letters is a dictionary that stored the integer frequency
count as its key and the list of letter strings as its values.
The little strings at the key frequency are being sorted, not the frequency to let the dictionary itself.
Dictionaries cannot be sorted because they have no audio.
There is no first or last evalu period as there is for the list items.
OK, notice that over here the string for some key was also in the reverse order of A2 on order because
the loop executed that evaluable.
It looked like multiple values for a particular keep.
The joint method then calls though, or changes the list of string into a single string.
So, for example, if you're having all the frequency of the index, what is B and W, which will be
joined us BWB and then we move on to sorting the dictionary list by frequency.
So if the fourth step over here is to get the frequency, order is to sort the strings from the frequency
to let Oresteia dictionary by the frequency count and to convert the string to the list.
So keep in mind that because the key value in dictionary are unordered, a list of values of all the
keys or values in a dictionary will be a list of items in random order.
This means that we will need to sort this list.
So using over here the keys, values and items dictionary method now coming to the keys, values and
items, dictionary method.
Each convert part of a dictionary into a non dictionary and after the dictionary is converted to another
type, it can be converted into a list using the list function.
So if we want to check all that, we will enter something in the interactive shell here.
We will.
This time is equal to see guides then comma C box C for and C mice in my c e as also for for example.
Then we take standard E we have the dictionary uses cats, dogs, mice.
OK, then we take your list.
Spambot keys.
We have your cats, dogs, mice again.
And if we check list spambot values we get the values.
Now to get the list of values in a dictionary, we use the Keys method to return the dictionary object
that we can then pass to the list function a similar dictionary method name values return a dictionary
values object.
These examples gives us a list of dictionary keys in the list of its values respectively.
Now to get both the keys and the values, we can then use the items dictionary method to return the
dictionary items object, which makes the key value pairs in two tuples.
We can then parse the stupid to list.
For example, if we say spam is equal to C gets cold and then C all three, C minus colon three, then
we see list.
OK, sorry I made some mistake.
Netas.
Cooperate on it three, and then we see a list in the bracket spam dot.
Items.
We get your cat, dogs, mice, so we're calling item the list, we can vote this from dictionary key
value pair into a list of Dupas.
This is exactly what we need to do with the frequency to let Alicja dictionary so we can sort the little
strings and the normal order of frequency.
So now we come to converting the dictionary items to sortable list the frequency to letter dictionary,
a dictionary which has integer frequency columns as its keys and the list of single letter strings as
its values.
So to solve the string in the frequency order, we call the items matter and the list function to create
a list of pupils to the dictionaries key value.
But then we store this list of pupils in a variable named frequency.
So if we go back to our program over here and you can check out here, we are having frequency here,
which is equal to list in frequency two, letter to standard items.
And then we are having frequency or better still, not sold by and the value.
But now we come to the fourth part that is converting the dictionary items to us or whatever list.
So the frequency to like Oresteia Dictionary has an integer frequency count, has its keys and list
of single letters string as its values.
So to sort the strings in the frequency, although we then call the items method and the list function
to create a list of tuples of the dictionaries key value.
But then we store this list of people in the variable named frequency.
So here we are having the frequency pairs created.
Then we pass the get item at index zero function over here in the sort that particular value that we
define earlier in the program to the third method.
That and.
So they get item index function, gets the first item in the Tupa, which in this case is the frequency
count in BIJA.
This means that the items in the frequency bed are sorted by the numerical order of the frequency count
integers.
Then also we pass through for the reverse arguments for the tubas are revulsed order from the largest
frequency count to the smallest.