Set Methods

PHOTO EMBED

Sat Apr 01 2023 19:37:18 GMT+0000 (Coordinated Universal Time)

Saved by @RightThere #sets #python

my_set.add(item)  # adds an item to the set
my_set.remove(item)  # removes an item from the set
my_set.union(other_set)  # returns a new set with all unique items from both sets
my_set.intersection(other_set)  # returns a new set with items that are common to both sets
content_copyCOPY

https://www.javacodegeeks.com/core-python-cheatsheet.html