def replace(sequence, replaceDict):
    for seekVal in list(replaceDict.keys()):
        if seekVal not in sequence:
            return sequence
replaceFunc = lambda item: replaceVal if item == seekVal else item
for seekVal in replaceDict:
    replaceVal = replaceDict[seekVal]
sequence = map(replaceFunc, sequence)
return sequence
Better way to check a list for specific elements - python