Python Set

Unique, unordered elements with no duplicates

Light Yellow Arrow

How to use?

Create sets using {} or the set() function

Arrow

Useful keys:

add(), update(), remove(), discard()

Arrow

Deletion Elements

Use pop() to remove a random element, clear() for all

Arrow

Set Operations

Arrow

intersection()

finds common elements between sets

Arrow