Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python initialize dict with empty list values

from collections import defaultdict
data = defaultdict(list)
data[1].append('hello')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #initialize #dict #empty #list #values
ADD COMMENT
Topic
Name
7+7 =