Definition:
The Union Operation is used when you have data from two sets and want only unique values from both sets.
It combines both sets and removes duplicate values.
Syntax:
result = set1 | set2
# or
result = set1.union(set2)
Example:
a = {1, 2, 3}
b = {2, 3, 4}
result = a | b
print(result)
Output:
Exercise
Perform union operation on sets a = {5, 6, 7} and b = {7, 8, 9} using Python.
