Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

python convert two lists with duplicates to dictiona

dict_1={}

for key,value in zip(list_one,list_two):
    if key not in dict_1:
        dict_1[key]=[value]
    else:
        dict_1[key].append(value)

print(dict_1)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #convert #lists #duplicates #dictiona
ADD COMMENT
Topic
Name
2+4 =