def strip_start_end(parts, start_symbol, end_symbol):
    """
    For every part in parts remove the start_symbol from the begin of part and the end_symbol from the end of part if
    both are present. Otherwise (if start_symbol or end_symbol is missing) leaves part unchanged.
    :param parts: A list of strings, which may start with start_symbol and end with end_symbol
    :type parts: List[str]
    :param start_symbol: The symbol to remove from the start of every part, if end_symbol is present at the end of this
    part.
    :param end_symbol: The symbol to remove from the end of every part, if start_symbol is present at the start of this
    part.
    :return: A new list containing the given parts but with removed start_symbol and end_symbol
    """
    stripped_parts = []
    for part in parts:
        if part.startswith(start_symbol) and part.endswith(end_symbol):
            stripped_part = part.lstrip(start_symbol).rstrip(end_symbol)
            stripped_parts.append(stripped_part)
        else:
            stripped_parts.append(part)
    return stripped_parts
