I used this code:
dictionary = dict(zip(list1, list2))
in order to map two lists in a dictionary. Where:
list1 = ('a','b','c')
list2 = ('1','2','3')
The dictionary equals to:
{'a': 1, 'c': 3, 'b': 2}
Is there a way to add a third list:
list3 = ('4','5','6')
so that the dictionary will equal to:
{'a': [1,4], 'c': [3,5], 'b': [2,6]}
This third list has to be added so that it follows the existing mapping.
The idea is to make this work iteratively in a for loop and several dozens of values to the correctly mapped keyword.
Is something like this possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…