1set1 = {2, 4, 5, 6}
2set2 = {4, 6, 7, 8}
3set3 = {7, 8, 9, 10}
4
5# union of two sets
6print("set1 U set2 : ", set1.union(set2))
7
8# union of three sets
9print("set1 U set2 U set3 :", set1.union(set2, set3))
10
11
12>>>
13
14set1 U set2 : {2, 4, 5, 6, 7, 8}
15set1 U set2 U set3 : {2, 4, 5, 6, 7, 8, 9, 10}
1set1 = {2, 4, 5, 6}
2set2 = {4, 6, 7, 8}
3set3 = {7, 8, 9, 10}
4
5# union of two sets
6print("set1 U set2 : ", set1.union(set2))
7
8# union of three sets
9print("set1 U set2 U set3 :", set1.union(set2, set3))