print(countstoo ugly items list(dictionary items()better items sort(for (keyvaluein itemsprint(keyvaluecounter py simply printing dictionary gives ugly output we can pull out the (key,valuepairs and print them individually if we want notice the use of pulling out the itemsconverting them into list and then sorting them