8

why there is attribute error in python 3. with what can i replace it ?

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
dhiraj262
  • 81
  • 1
  • 1
  • 4

0 Answers0