def replace ( s , old , new , maxreplace = - 1 ) : return s . replace ( old , new , maxreplace )
how to replace a substring in a python sdtring
replace ( str old new [ maxreplace ] ) - > string
def replace(s, old, new, maxreplace=-1):
    """replace (str, old, new[, maxreplace]) -> string

    Return a copy of string str with all occurrences of substring
    old replaced by new. If the optional argument maxreplace is
    given, only the first maxreplace occurrences are replaced.

    """
    return s.replace(old, new, maxreplace)