I have two lists:
alist = ['key1','key2','key3','key3','key4','key4','key5']
blist= [30001,30002,30003,30003,30004,30004,30005]
I want to merge these lists and add them to a dictionary.
I try dict(zip(alist,blist))
but this gives:
{'key3': 30003, 'key2': 30002, 'key1': 30001, 'key5': 30005, 'key4': 30004}
The desired form of the dictionary is:
{'key1': 30001, 'key2': 30002, 'key3': 30003,'key3':30003, 'key4': 30004, 'key4': 30004, 'key5': 30005}
I want to keep the duplicates in the dictionary as well as not join the values in the same key (... key3': 30003,'key3':30003,... ).Is it possible?
Thanks in advance.