-
-
Save codecademydev/3a26efe9d5162100f83173a8e326fc67 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def frequency_dictionary(words): | |
dictionary = {} | |
for word in words: | |
dictionary[word] = 0 | |
for word in words: | |
dictionary[word] += 1 | |
return dictionary | |
print(frequency_dictionary(["apple", "apple", "cat", 1])) | |
print(frequency_dictionary([0,0,0,0,0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment