9 lines
297 B
Plaintext
9 lines
297 B
Plaintext
|
# Merge example
|
||
|
def mergeWithoutOverlap(oneDict, otherDict):
|
||
|
newDict = oneDict.copy()
|
||
|
for key in otherDict.keys():
|
||
|
if key in oneDict.keys():
|
||
|
raise ValueError, "the two dictionaries are sharing keys!"
|
||
|
newDict[key] = otherDict[key]
|
||
|
return newDict
|
||
|
|