For instance, say I wanted a function to escape a string for use in HTML (as in Django\'s escape filter):
def escape(string): \"\"\" Retu
I prefer something clean like:
substitutions = [ ('<', '<'), ('>', '>'), ...] for search, replacement in substitutions: string = string.replace(search, replacement)