# Write your frequency_dictionary function here:
def frequency_dictionary(words):
empty_dict = {}
for word in words:
if word not in empty_dict:
empty_dict[word] = 0
for word in words:
empty_dict[word] += 1
return empty_dict
# Uncomment these function calls to test your function:
print(frequency_dictionary(["apple", "apple", "cat", 1]))
# should print {"apple":2, "cat":1, 1:1}
print(frequency_dictionary([0,0,0,0,0]))
# should print {0:5}
########
OFFICIAL
########
def frequency_dictionary(words):
freqs = {}
for word in words:
if word not in freqs:
freqs[word] = 0
freqs[word] += 1
return freqs