I have two lists:
list1 = ['670', '619', '524', '670', '693', '693', '693', '632', '671']
list2 = ['JAIPUR', 'MUMBAI', 'DELHI', 'UDAIPUR', 'GOA', 'GOA', 'GOA', 'LUCKNOW', 'JAIPUR']
I want to make a dictionary out of this. Please note the two lists exactly in the order that it should be mapped into. Like for key '670' value us 'JAIPUR' and so on.
But when I tried, it gives output as:
d = dict(zip(list1, list2))
{'670': 'UDAIPUR', '619': 'MUMBAI', '524': 'DELHI', '693': 'GOA', '632': 'LUCKNOW', '671': 'JAIPUR'}
It takes only the latest value if multiple values are found for a single key. However what I want is multiple values for a single key like 670 should have:
'670': ['JAIPUR', 'UDAIPUR']
Can anyone help.