control structures and functions def letter_count(textletters=string ascii_letters)letters frozenset(letterscount for char in textif char in letterscount + return count we have specified default value for the letters parameter by using the parameter=default syntax this allows us to call letter_count(with just one argumentfor exampleletter_count("maggie and hopey"hereinside the functionletters will be the string that was given as the default value but we can still change the defaultfor exampleusing an extra positional argumentletter_count("maggie and hopey""aeiouaeiou")or using keyword argument (covered next)letter_count("maggie and hopey"letters="aeiouaeiou"the parameter syntax does not permit us to follow parameters with default values with parameters that don' have defaultsso def bad(ab= )won' work on the other handwe are not forced to pass our arguments in the order they appear in the function' definition--insteadwe can use keyword argumentspassing each argument in the form name=value here is tiny function that returns the string it is givenor if it is longer than the specified lengthit returns shortened version with an indicator addeddef shorten(textlength= indicator=")if len(textlengthtext text[:length len(indicator)indicator return text here are few example callsshorten("the silkie"returns'the silkieshorten(length= text="the silkie"returns'the shorten("the silkie"indicator="&"length= returns'the si&shorten("the silkie" "&"returns'the si&because both length and indicator have default valueseither or both can be omitted entirelyin which case the default is used--this is what happens in the first call in the second call we use keyword arguments for both of the specified parametersso we can order them as we like the third call mixes both positional and keyword arguments we used positional first argument (positional arguments must always precede keyword arguments)and then two keyword arguments the fourth call simply uses positional arguments the difference between mandatory parameter and an optional parameter is that parameter with default is optional (because python can use the default)and parameter with no default is mandatory (because python can