I am trying to figure out how to remove the common values in two sets.
set1={":dog","cat","mouse"}
set2={"bird","dog","house","fish"}
So the result is just {"cat","mouse","bird","house","fish"}
.
I was looking on stack overflow and found this Removing the common elements between two lists but I'm not sure if it's specific to numbers or like the old python format because it wasn't working.
In my code I first got rid of the : in set1 by doing
line = re.sub('[:]', '', str(set1))
then I did :
res=list(set(line)^set(set2))
and I also tried
res=list(line^set2)
but the output is very strange it's
[',', 'u', 'c', '{', "'", 'o', 's', 'g', 'house', 'd', 't', 'bird', 'fish', 'm', 'dog', 'a', 'e', ' ', '}']