Loading, please wait...

Set Operations

Different Set Operations

 

Code:

E = {0, 2, 4, 6, 8};

N = {1, 2, 3, 4, 5};

print("Union of E and N is",E | N)
print("Intersection of E and N is",E & N)
print("Difference of E and N is",E - N)
print("Symmetric difference of E and N is",E ^ N)

 

Then, Click on the run button to execute it.