{1, 2, 3, 4, 5}
.add(value)
adds an element to the set.discard(value)
discards the specified value.union(set2)
returns a set with the all elements in both sets.intersection(set2)
returns a set with the all elements in commonpresences = {"Anna", "Beatrice", "Claude"}
absences = {"Elvin", "Harley"}
absences.add("Becca")
presences.union(absences)
{'Anna', 'Beatrice', 'Becca', 'Claude', 'Elvin', 'Harley'}
common_values
False
if the sets have no elements in common, True
otherwisediscard_elements
set_1
and set_2
set_1
) removing all elements it has in common with set_2