Created
May 9, 2015 13:30
-
-
Save gardyna/cc51e123e89c2a0f7875 to your computer and use it in GitHub Desktop.
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
#list construction | |
my_dict = dict() | |
for l in lists: | |
for name in lst: | |
my_dict[name] = my_dict.get(name, 0)+1 | |
# dict.get(key, default) return value associated with key or default if none is found |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment