Strings, Dictionaries
def word_count(phrase):
"""Count words in a sentence, and print in ascending order."""
# START SOLUTION
word_count = {}
for word in phrase.split():
word_count[word] = word_count.get(word, 0) + 1
counts = [(count, word) for word, count in word_count.items()]
counts.sort()
for count, word in counts:
print("%s: %s" % (word, count))