I have multiple dicts/key-value pairs like this:
d1 = {key1: x1, key2: y1}
d2 = {key1: x2, key2: y2}
I want the result to be a new dict (in most efficient way, if possible):
d = {key1: (x1, x2), key2: (y1, y2)}
Actually, I want result d to be:
d = {key1: (x1.x1attrib, x2.x2attrib), key2: (y1.y1attrib, y2.y2attrib)}
If somebody shows me how to get the first result, I can figure out the rest.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…