Update set_operation.py

This commit is contained in:
Luke Weiler
2020-10-21 14:16:11 -04:00
committed by GitHub
parent b9fbf4cbfc
commit 616cc61390

View File

@@ -15,3 +15,7 @@ def set_operation(minval=3, maxval=7, n_a=4, n_b=5):
problem = "Given the two sets a=" + str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference"
solution = "Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is " + str(a.difference(b)) + ",b-a is " + str(b.difference(a)) + ", Symmetric difference is " + str(a.symmetric_difference(b))
return problem, solution
setoperations = Generator("Union,Intersection,Difference of Two Sets", 93,
"Union,intersection,difference",
"aUb,a^b,a-b,b-a,", set_operation)