(text, *pairs)
return text
Do a series of global replacements on a string.
Do a series of global replacements on a string.
Do a series of global replacements on a string .
def replace(text, *pairs):
    """Do a series of global replacements on a string."""
    while pairs:
        text = pairs[1].join(text.split(pairs[0]))
        pairs = pairs[2:]
    return text
def replace ( text , * pairs ) : while pairs : text = pairs [ 1 ] . join ( text . split ( pairs [ 0 ] ) ) pairs = pairs [ 2 : ] return text