Count Word Frequencies
Turn a list of words into a dictionary from each word to how many times it appears.
The problem
Implement word_frequencies(words). words is a list of strings. Return a dictionary that maps each distinct word to the number of times it appears in the list. For example, ["red", "blue", "red"] gives {"red": 2, "blue": 1}, and an empty list gives an empty dictionary.
Starter code
def word_frequencies(words):
passPublic examples
words = ["red", "blue", "red"]gives{"red": 2, "blue": 1}
Solving it in the practice book needs an active paid plan.
Open it in the practice bookOne thought at a time.
