Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Whatever
defaultdict count key value pairs
jorfus
Programming language:
Whatever
2021-06-26 20:38:08
0
Q:
defaultdict count key value pairs
Akshay Arora
Code:
Whatever
2021-07-09 11:47:44
d = {
'a'
:
1
,
'b'
:
1
,
'c'
:
3
,
'd'
:
4
} >>> sum(d.
values
())
0
Tags
key
value
count
pair
dict
Related
defaultdict check if key exists
defaultdict key exists
defaultdict item count
count dictionary keys
defaultdict initialize keys
New to Communities?
Join the community