crayon-syntax-highlighter/util/sample/python.txt
2019-08-30 19:30:19 +02:00

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