Set Methods Flashcards
Definition set
A collection that is unordered and unindexed.
set.add()
Add an element to the set.
set.clear()
Removes all elements from the set.
set.copy()
Returns a copy of the set.
set.difference()
Returns a set containing the difference between two or more sets.
set.difference_update()
Removes the items in the set that are also included in another specified set.
set.discard()
Removes the specified item.
set.intersection()
Returns the intersection of two other sets.
set.intersection_update()
Removes the items in this set not present in the other.
set.isdisjoint()
Returns true if the sets do not intersect.
set.issubset()
Returns true if it is a subset.
set.issuperset()
Returns true if this set contains another set.
set.pop()
Removes an element from the set.
set.remove()
Removes the specified element.
set.symmetric_difference()
Returns a set with the symmetric difference of two sets