def switch_equality(bundle1:str, bundle2:str, prices:list):
    """
    Given two bundles, create a symbolic equality determining that the
    price of these bundles should be equal.

    :param bundle1, bundle2: strings representing bundles, e.g. "21", "4".
    :param prices:  a list of symbols, e.g. symbols('p3,p2,p1')
    :return: a symbolic expressions that should be equal to 0.

    >>> prices = symbols('p5,p4,p3,p2,p1')
    >>> switch_equality("5","42", prices)
    -p2 - p4 + p5
    >>> switch_equality("42","5", prices)
    p2 + p4 - p5
    """
    itemcount = len(prices)
    eq = 0
    for item in bundle1:
        if int(item)>0:
            eq += prices[itemcount-int(item)]
    for item in bundle2:
        if int(item)>0:
            eq -= prices[itemcount-int(item)]
    return eq