[ create a new paste ] login | about

Link: http://codepad.org/5KgO0b1G    [ raw code | output | fork ]

Python, pasted on Dec 16:
1
2
3
4
5
6
aSourceDictionary = { 'abc' : [1,2,3] , 'ccd' : [4,5] }
aTargetDictionary = {}
for aKey in aSourceDictionary:
        aTargetDictionary[aKey] = []
        aTargetDictionary[aKey].extend(aSourceDictionary[aKey])
print aTargetDictionary


Output:
1
{'ccd': [4, 5], 'abc': [1, 2, 3]}


Create a new paste based on this one


Comments: