arguments-- special "name=valuesyntax in function calls that specifies passing by name and is often used for giving configuration options in sortsthe reverse argument allows sorts to be made in descending instead of ascending orderand the key argument gives one-argument function that returns the value to be used in sorting--the string object' standard lower case converter in the following (though its newer casefold may handle some types of unicode text better) ['abc''abd''abe' sort( ['abd''abe''abc' ['abc''abd''abe' sort(key=str lowerl ['abc''abd''abe' ['abc''abd''abe' sort(key=str lowerreverse=truel ['abe''abd''abc'sort with mixed case normalize to lowercase change sort order the sort key argument might also be useful when sorting lists of dictionariesto pick out sort key by indexing each dictionary we'll study dictionaries later in this and you'll learn more about keyword function arguments in part iv comparison and sorts in xin python xrelative magnitude comparisons of differently typed objects ( string and listwork--the language defines fixed ordering among different typeswhich is deterministicif not aesthetically pleasing that isthe ordering is based on the names of the types involvedall integers are less than all stringsfor examplebecause "intis less than "strcomparisons never automatically convert typesexcept when comparing numeric type objects in python xthis has changedmagnitude comparison of mixed types raises an exception instead of falling back on the fixed cross-type ordering because sorting uses comparisons internallythis means that [ 'spam'sort(succeeds in python but will raise an exception in python sorting mixed-types fails by proxy python also no longer supports passing in an arbitrary comparison function to sortsto implement different orderings the suggested workaround is to use the key=func keyword argument to code value transformations during the sortand use the reverse=true keyword argument to change the sort order to descending these were the typical uses of comparison functions in the past lists in action