Sets · Python example
Compare two skill sets with union, intersection, and difference.
Sets store unique values and support mathematical operations. They are ideal for comparing groups of items.
frontend = {"HTML", "CSS", "JavaScript"}
backend = {"Python", "JavaScript", "SQL"}
print("Union:", ", ".join(sorted(frontend | backend)))
print("Intersection:", ", ".join(sorted(frontend & backend)))
print("Frontend only:", ", ".join(sorted(frontend - backend)))