Assume I've got the dictionaries:
dict1 = {'A': 1, 'B': 2, 'C' : 3}
dict2 = {'a': 4, 'b': 5, 'c' : 6}
This link suggest several ways to merge the two but all of the merges are simply concatenations. I want to merge them like a dealer shuffles cards, or like a zipper zips. What I mean by this is that once merging dict1
and dict2
, the resulting dict3
should become
dict3 = {'A': 1, 'a': 4, 'B': 2, 'b': 5, 'C' : 3, 'c' : 6}
So the merge grabs elements from dict1
and dict2
in an alternating fashion. My dictionaries are in fact very large so doing it manually is not an option.