set symmetric difference
- set
- symmetric_difference
english = set(['door', 'car', 'lunar', 'era'])
spanish = set(['era', 'lunar', 'hola'])
diff = english.symmetric_difference(spanish)
print('symmetric_difference: ', diff)
- Symmetric difference contains all the elements in either one of the sets, but not in both. "the ears of the elephant".
Output:
symmetric_difference: {'door', 'hola', 'car'}