######################Problem 3########################### def sort_letters_backward(word): """prec: word is a lower-case string postc: returns a string with the letters in word sorted in reverse alphabetical order """ chars = list(word) chars.sort(reverse=True) return "".join(chars) def sort_letters_backward(word): """prec: word is a lower-case string postc: returns a string with the letters in word sorted in reverse alphabetical order """ return "".join(reversed(sorted(word))) def sort_letters_backward(word): """prec: word is a lower-case string postc: returns a string with the letters in word sorted in reverse alphabetical order """ return "".join(sorted(word, reverse=True)) def main(): print("*************** Problem 3 Tests **************") print(sort_letters_backward("hammer") == "rmmhea") main()