Home / Python Tips Generated By ChatGPT / Set Operations: Union, Intersection, Difference in Python Perform mathematical set operations. Source Code a = {1, 2, 3} b = {3, 4, 5} print(a | b) # Union print(a & b) # Intersection print(a - b) # Difference