I am trying to create a dictionary from two lists, the dictionary should do a one-one mapping of each element of the listA to the corresponding element in the listB at the same index ,I have the current output and expected output below, can anyone suggest how to fix this?
destination_milestones_gerrit_branches ={}
destination_milestones =['m1','m2','m3']
gerrit_branches = ['b1','b2','b3']
for milestone in destination_milestones:
print milestone
for branch in gerrit_branches:
print branch
destination_milestones_gerrit_branches[milestone]= branch
print destination_milestones_gerrit_branches
Current output:-
{'m1': 'b3', 'm3': 'b3', 'm2': 'b3'}
Expected output:-
{'m1': 'b1', 'm2': 'b2','m3':'b3'}