Home / Python Tips Generated By ChatGPT / Using Sets for Unique Collections and Operations in Python Perform mathematical set operations like union and intersection. Source Code a = {1, 2, 3} b = {3, 4, 5} print(a | b) # Union print(a & b) # Intersection