We use cookies to enhance your browsing experience.

Learn More
Back to Library
PYTHONpython

Set Operations

Union and intersection.

a = {1, 2, 3}
b = {3, 4, 5}
print(a | b) # Union {1, 2, 3, 4, 5}
print(a & b) # Intersection {3}
python set math
25+Total Tools
Operations
4Languages
100%Privacy

We use cookies to enhance your experience and serve personalized ads.