Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python dictionary append value if key exists

from collections import defaultdict
d = defaultdict(list)
d['key'].append('mykey')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #dictionary #append #key #exists
ADD COMMENT
Topic
Name
3+1 =