🐍
Python Sets
An animated visual guide — no boring text walls, just motion and logic.
✦ Unique values
✦ Unordered
✦ No duplicates
✦ Union · Intersection · Difference
Creating a Set — Duplicate Rejection
Watch what happens when duplicates try to sneak in
my_set
values will appear here…
my_set = set()
Sets Are Unordered
The same values — but Python decides where they live
Sets have no guaranteed order — positions are meaningless
print(my_set) → {3, 1, 4, 2, 5} ← could be anything!
Adding Elements
Try adding something new — then try adding a duplicate
my_set.add( ? )
Removing Elements
Click any bubble to remove it from the set
Click a value to call my_set.discard(value)
my_set.discard( ? )
Set Operations
Watch the math happen visually