def fill(lst, mold, subs):
    """For every <mold> element in <lst>, substitute for the according
    <subs> value (indexically).  """

    nlst = list(lst).copy()

    j = 0
    for i, elem in enumerate(lst):
        if elem == mold:
            nlst[i] = subs[j]
            j += 1

    return nlst