def list_replace ( subject_list , replacement , string ) : for s in subject_list : string = string . replace ( s , replacement ) return string
python replace string using nested for loop
To replace a list of items by a single replacement : param subject_list : list : param replacement : string : param string : string : return : string
def list_replace(subject_list, replacement, string):
    """
    To replace a list of items by a single replacement
    :param subject_list: list
    :param replacement: string
    :param string: string
    :return: string
    """
    for s in subject_list:
        string = string.replace(s, replacement)
    return string