dict1 = {a:10, b:15, c:20}
dict2 = {a:25, b:30, c:35}
我希望输出是:
dict3 = {a : (10, 25), b : (15, 30), c : (20, 35)}
这是我所拥有的样本
dict1 = {'192.168.1.21':23,'127.0.0.1':5,'12.12.12.12':5,'55.55.55.55':10}
dict2 = {'192.168.1.21':27,'10.10.0.1':7,'127.0.0.1':1}
dict3 = {}
for dictionary in (dict1,dict2):
for k,v in dictionary.iteritems():
dict3[k] = dict3.get(k, 0) + v
谁能帮我这个