Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

dictionary with list as value py

dict = {}
key = 1
value = "test"
dict.setdefault(key, []).append(value)
 
PREVIOUS NEXT
Tagged: #dictionary #list #py
ADD COMMENT
Topic
Name
6+5 =