note the form of the string assigned the name numberformatit has the english words for numbers in braces where we want the spanish definitions substituted (this is unlike in string format operation (page )where we had empty braces or numerical index inside as in string format operation (page )the second line uses method calling syntax reminder of the syntax for methodsobject methodname(parametershas the object followed by period followed by the method nameand further parameters in parentheses in the example abovethe object is the string called numberformat the method is named format the parameters in this case are all keyword parameters you have already seen keyword parameter sep used in print function calls in this particular applicationthe keywords are chosen to include all the words that appear enclosed in braces in the numberformat string when the string numberformat has the format method applied to it with the given keyword parametersa new string is created with substitutions into the places enclosed in braces the substitutions are just the values given by the keyword parameters hence the printed result is count in spanishunodostresnow we go one step furtherthe keyword parameters associate the keyword names with the values after the equal signs the dictionary from spanish py includes exactly the same associations there is special notation allowing such dictionary to supply keyword parameters assuming dictionary is the spanish dictionary from spanish pythe method call numberformat format(one='uno'two='dos'three='tres'returns the same string as numberformat format(**dictionarythe special syntax *before the dictionary indicates that the dictionary is not to be treated as single actual parameter instead keyword arguments for all the entries in the dictionary effectively appear in its place below is substitute for the main method in spanish py the whole revised program is in example program spanish pydef main()dictionary createdictionary(numberformat "count in spanish{one}{two}{three}withsubstitutions numberformat format(**dictionaryprint(withsubstitutionsprint("spanish colors{red}{blue}{green}format(**dictionary)in this main function the string with the numbers is constructed in steps as discussed above the printing of the string with the spanish colors is coded more concisely there are not named variables for the format string or the resulting formatted string you are free to use either coding approach in generaluse this syntax for the string format method with dictionaryreturning new formatted stringformatstring format(**adictionarywhere the format string contains dictionary keys in braces where you want the dictionary values substituted the dictionary key names must follow the rules for legal identifiers at this point we have discussed in some detail everything that went into the first sample programmadlib pyin sample programexplained (page )this is certainly the most substantial program so far dictionaries