Created
June 5, 2019 12:01
-
-
Save Linus-Albertus/1a7c3d8b3fa7f8e7a8808188bc096b31 to your computer and use it in GitHub Desktop.
[item freqs dictionary] Add an item / frequency to a dictionary #dict
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
items_list = [a, b, b, c, c, c] | |
for i in items_list: | |
items_list.setdefault(i, 0) | |
items_list[i] += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment