merger two dict in python like this

Viewed 70

I want merge two dict like this:

from:

  a1 = {u'2016-03-11': [u'20:00', u'22:10']}
  a2 = {u'2016-03-11': [u'20:00', u'23:10'],u'2016-03-12': [u'20:00', u'22:10']}

to:

  an = {u'2016-03-11': [u'20:00',u'22:10', u'23:10'],u'2016-03-12': [u'20:00', u'22:10']}

i need a function merge two dict

6 Answers
Related