Task: You have two lists of IDs. You need to find all IDs that are present in either list but not in both (the symmetric difference).
List 1: $[101,102,103,104]$
List 2: $[103,104,105,106]$
Expected Result:
\[
\{101,102,105,106\}
\]
Which Python set operation or method achieves this?
- $\texttt{set(list1)&set(list2)} $
- $\texttt{set(list1).union(list2)}$
- $\texttt{set(list1)}$ ^ $\texttt{set(list2)}$
- $\texttt{set(list1).intersection(list2)}$