fork
This commit is contained in:
9
util/sample/python.txt
Normal file
9
util/sample/python.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# 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
|
||||
|
Reference in New Issue
Block a user