This commit is contained in:
lukew3
2020-10-21 14:34:42 -04:00
parent 55fb0a18f6
commit d647e9710f
31 changed files with 117 additions and 76 deletions

View File

@@ -14,11 +14,14 @@ def set_operation(minval=3, maxval=7, n_a=4, n_b=5):
b = set(b)
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))
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
set_operation = Generator("Union,Intersection,Difference of Two Sets", 93,
"Union,intersection,difference",
"aUb,a^b,a-b,b-a,", set_operation)
"Union,intersection,difference", "aUb,a^b,a-b,b-a,",
set_operation)