crayon-syntax-highlighter/util/sample/python.txt

9 lines
297 B
Plaintext
Raw Normal View History

2019-08-30 19:30:19 +02:00
# 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