I have two python dictionaries, say,
d1 = {'k1':'v1', 'k2':'v2', 'k3':'v3'}
d2 = {'v1':'w1','v2':'w2','v5':'w5'}
what I need is a merged dict like this -
mergeDict= {k1:(v1,w1), k2:(v2,w2), k3:(v3)}
Whatever I have been able to look up or read has dealt with appending dictionaries, nothing like this. I called this chaining since value of first dict is potentially the key in second dict.
So far i have done this through typical loop and lookup on keys(). Wondering if there is a more pythonic way to achieve this that i might be missing here ?