Write a Python program to return a set of all elements in either A or B, but not both


Topic: Write a Python program to return a set of all elements in either A or B, but not both

Solution

set1 = {10, 20, 30, 40, 50}
set2 = {30, 40, 50, 60, 70}
print(set1.symmetric_difference(set2))



List all Python Programs