def replace_last(source_string, replace_what, replace_with):
    """
    Function that replaces the last ocurrence of a string in a word
    """
    head, _sep, tail = source_string.rpartition(replace_what)
    return head + replace_with + tail