Given two lists, the objective is to find the non-overlapping value between them.
Based on the suggestion discussed in OP. This can be achieved either of the two approach
list_one=['ISL','BUK','ORG','CLC','STS','PLP','t1','t2','t3','t4','DE1','DE2','DE4']
list_two=['t1','t2','t3','t4']
APP1=set(list_one) ^ set(list_two)
APP2 = set(list_one).symmetric_difference(list_two)
Both suggestion outputted
{'DE4', 'DE2', 'CLC', 'STS', 'ORG', 'BUK', 'ISL', 'DE1', 'PLP'}
While this work, but the order from list_one
is distorted.
My question is, how can the above code be modified to output as below, where, the ordering follow as per in list_one
EXPECTED_OUTPUT=['ISL','BUK','ORG','CLC','STS','PLP','DE1','DE2','DE4']