Exercise 12.2. In this example, ties are broken by comparing words, so words with the same length appear in reverse alphabetical order.
For other applications you might want to break ties at random.
Modify this example so that words with the same length appear in random order.
Hint: see the random function in the random module.