nowlet' say we are given the following dictionaryenglish words as keys and french words as values our task is to place these string values in correct numerical orderd ={'one':'uno'two':'deux''three':'trois''four''quatre''five''cinq''six':'six'of coursewhen we print this dictionary outit will be unlikely to print in the correct order because all keys and values are stringswe have no context for numerical ordering to place these items in correct orderwe need to use the first dictionary we createdmapping words to numerals as way to order our english to french dictionarynotice we are using the values of the first dictionarydto sort the keys of the second dictionaryd since our keys in both dictionaries are the samewe can use list comprehension to sort the values of the french to english dictionarywe canof coursedefine our own custom method that we can use as the key argument to the sorted method for examplehere we define function that simply returns the last letter of stringdef corder(string)return(string[len(string)- ]we can then use this as the key to our sorted function to sort each element by its last letter