Answers for "zip two lists to dictionary python with repeated values"

1

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)
Posted by: Guest on November-10-2020

Code answers related to "zip two lists to dictionary python with repeated values"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language