Challenge 1: Word Frequency Counter — Possible Solution ==================================================================== words = ["apple", "banana", "apple", "cherry", "banana", "apple"] counts = {} for word in words: counts[word] = counts.get(word, 0) + 1 print(counts) Output: {'apple': 3, 'banana': 2, 'cherry': 1} WHY THIS WORKS AS AN ANSWER ------------------------------ counts starts as an empty dictionary, then the for loop from Chapter 4 visits each word in the list one at a time. counts.get(word, 0) reuses the chapter's own .get()-with-default pattern: if word has already been seen and has a running count in counts, that count is returned; if word has never been seen before, 0 is returned instead of raising a KeyError the way counts[word] alone would for a first-time key. Adding 1 to whatever .get() returns and assigning it straight back to counts[word] handles both cases with the same single line — a brand new word gets counts[word] = 0 + 1 = 1, and a repeated word gets its existing count incremented by one. No separate "if word not in counts" check is needed, because .get()'s default already covers the missing case.