def fix(in_str, bad_chs, sub):
    """
    This replaces in 'in_str' each character of 'bad_chs' by a 'sub'

    Parameters
    ----------
    in_str : str
    bad_chs : str
    sub : str

    Returns
    -------
    str

    """
    for c in bad_chs:
        in_str = in_str.replace(c, sub)
    return in_str