为什么python 3中存在属性错误。 有什么可以取代它?
d1 = {'a':1,'b':2}
d2 = {'c':4,'d':5}
def switch(d1,d2):
dout = {}
for d1key,d2val in zip(d1,d2.itervalues):
dout[d1key] = d2val
return dout
switch(d1,d2)
---------------------------------------------------------------------------
AttributeError: 'dict' object has no attribute 'itervalues